Update README.md

This commit is contained in:
akamhy 2020-05-07 15:12:37 +05:30 committed by GitHub
parent 538afb14e9
commit ba46cdafe2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -144,6 +144,23 @@ print(webpage)
``` ```
> This should print the source code for <https://example.com/>. > This should print the source code for <https://example.com/>.
#### Count total archives for an url. Using total_archives()
```diff
+ waybackpy.total_archives(url, UA=user_agent)
```
> url is mandatory. UA is not, but highly recommended.
```python
from waybackpy import total_archives
# retriving the webpage from any url including the archived urls. Don't need to import other libraies :)
# Default user-agent (UA) is "waybackpy python package", if not specified in the call.
# supported argumnets are url and UA
count = total_archives("https://en.wikipedia.org/wiki/Python (programming language)", UA="User-Agent")
print(count)
```
> This should print an integer (int), which is the number of total archives on archive.org
## Tests ## Tests
* [Here](https://github.com/akamhy/waybackpy/tree/master/tests) * [Here](https://github.com/akamhy/waybackpy/tree/master/tests)