Created
September 17, 2018 08:42
-
-
Save aalipar13/86a310ce31ed42724f3aa0a0addc0ab9 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 | |
headers = requests.utils.default_headers() | |
headers.update({ | |
'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0', | |
}) | |
url = 'https://www.costco.com/' | |
response = requests.get(url, headers=headers) | |
soup = BeautifulSoup(response.content) | |
f = soup.find('div', attrs={'data-bi-placement': 'Home_Hero_Carousel'}) | |
print(f.contents) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment