File tree 3 files changed +71
-0
lines changed
3 files changed +71
-0
lines changed Original file line number Diff line number Diff line change @@ -161,6 +161,38 @@ const response = await localScraper(
161
161
162
162
</CodeGroup >
163
163
164
+ ### Async Support
165
+
166
+ For applications requiring asynchronous execution, LocalScraper provides async support through the ` AsyncClient ` :
167
+
168
+ ``` python
169
+ from scrapegraph_py import AsyncClient
170
+ import asyncio
171
+
172
+ async def main ():
173
+ html_content = """
174
+ <html>
175
+ <body>
176
+ <h1>Product: Gaming Laptop</h1>
177
+ <div class="price">$999.99</div>
178
+ <div class="description">
179
+ High-performance gaming laptop with RTX 3080.
180
+ </div>
181
+ </body>
182
+ </html>
183
+ """
184
+
185
+ async with AsyncClient(api_key = " your-api-key" ) as client:
186
+ response = await client.localscraper(
187
+ website_html = html_content,
188
+ user_prompt = " Extract the product information"
189
+ )
190
+ print (response)
191
+
192
+ # Run the async function
193
+ asyncio.run(main())
194
+ ```
195
+
164
196
## Integration Options
165
197
166
198
### Official SDKs
Original file line number Diff line number Diff line change @@ -89,6 +89,25 @@ The response includes:
89
89
- ` error ` : Error message (if any occurred during conversion)
90
90
</Accordion >
91
91
92
+ ### Async Support
93
+
94
+ For applications requiring asynchronous execution, Markdownify provides async support through the ` AsyncClient ` :
95
+
96
+ ``` python
97
+ from scrapegraph_py import AsyncClient
98
+ import asyncio
99
+
100
+ async def main ():
101
+ async with AsyncClient(api_key = " your-api-key" ) as client:
102
+ response = await client.markdownify(
103
+ website_url = " https://example.com/article"
104
+ )
105
+ print (response)
106
+
107
+ # Run the async function
108
+ asyncio.run(main())
109
+ ```
110
+
92
111
## Integration Options
93
112
94
113
### Official SDKs
Original file line number Diff line number Diff line change @@ -149,6 +149,26 @@ const response = await smartScraper(
149
149
150
150
</CodeGroup >
151
151
152
+ ### Async Support
153
+
154
+ For applications requiring asynchronous execution, SmartScraper provides async support through the ` AsyncClient ` :
155
+
156
+ ``` python
157
+ from scrapegraph_py import AsyncClient
158
+ import asyncio
159
+
160
+ async def main ():
161
+ async with AsyncClient(api_key = " your-api-key" ) as client:
162
+ response = await client.smartscraper(
163
+ website_url = " https://example.com" ,
164
+ user_prompt = " Extract the main content"
165
+ )
166
+ print (response)
167
+
168
+ # Run the async function
169
+ asyncio.run(main())
170
+ ```
171
+
152
172
## Integration Options
153
173
154
174
### Official SDKs
You can’t perform that action at this time.
0 commit comments