Created
July 26, 2020 11:53
-
-
Save sunwicked/433be8268abf65cba22febd1f80d1b6c to your computer and use it in GitHub Desktop.
Scrape Country rank from alexa for a site
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 | |
URL = 'https://alexa.com/siteinfo/theayurveda.org' | |
page = requests.get(URL) | |
soup = BeautifulSoup(page.content, 'html.parser') | |
results = soup.find_all('span', class_='pull-right') | |
for result in results: | |
if '#' in result.text.strip(): | |
print(result.text.strip()) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment