Last active
August 11, 2019 12:37
-
-
Save songthamtung/172c13f87cdacdbfe2270c011cb13622 to your computer and use it in GitHub Desktop.
This file contains 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 | |
result = requests.get("https://www.webscraper.io/test-sites/e-commerce/allinone") | |
soup = BeautifulSoup(result.content) | |
links = soup.find_all("a", "title") | |
data = {} | |
for link in links: | |
title = link.string | |
data[title] = link.attrs['href'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment