Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
akneni committed Mar 30, 2024
1 parent 249ac60 commit d23d850
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,20 @@ import pygrab
pygrab.Tor.start_tor()

urls = ['http://example.com', 'http://example.org', 'http://example.net']
responses = pygrab.get_async(urls)
responses = pygrab.get_batch(urls)

for response in responses.values():
print(response.text)
```

In this example, `responses` is a dictionary of urls matched to their respective `pygrab.HttpResponse` objects. Each response corresponds to the URL at the same index in the `urls` list.

We can also use pygrab with python's `async/await` syntax.
```python
async def grab_data():
res = await pygrab.get_async('https://www.google.com')
return res
```

## Contributing

Expand Down

0 comments on commit d23d850

Please sign in to comment.