Last active
February 20, 2021 03:53
-
-
Save sertalpbilal/5b241eff7a707a03b2241f84cf7ddb04 to your computer and use it in GitHub Desktop.
Useful parts for microcenter scraper
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 | |
result = requests.get(r'https://www.microcenter.com/product/630283/amd-ryzen-9-5900x-vermeer-37ghz-12-core-am4-boxed-processor?storeid=071') | |
print(result.status_code) # This should be 200 if all goes OK | |
print(result.text) # This text will go to Beautiful Soup |
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 bs4 import BeautifulSoup | |
result = requests.get('...') | |
soup = BeautifulSoup(result.text, 'html.parser') | |
count = soup.find(class_='inventoryCnt') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment