Last active
July 17, 2019 17:25
-
-
Save Yousuf28/8eea202bc4413d0da0e021b98f43ebee 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
from requests import get | |
from bs4 import BeautifulSoup | |
# link | |
url = 'https://www.drugs.com/pharmaceutical-companies.html' | |
response = get(url) | |
soup = BeautifulSoup(response.text, 'html.parser') | |
links = [] | |
for a in soup.find_all('a', href=True): | |
link = a['href'] | |
links.append(link) | |
links = links[62:-26] | |
print(len(links)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment