Created
August 11, 2021 15:07
-
-
Save AnderRV/155f95c4dfabbdfe973bfabdcbdc96ea to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
to_visit = set() | |
response = requests.get('https://scrapeme.live/shop/page/1/') | |
soup = BeautifulSoup(response.content, 'html.parser') | |
for a in soup.select('a.page-numbers'): | |
to_visit.add(a.get('href')) | |
print(to_visit) | |
# {'https://scrapeme.live/shop/page/2/', '.../3/', '.../46/', '.../48/', '.../4/', '.../47/'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment