Python BeautifulSoup Returning Empty List
I'm trying to create a Python script to pull prices of Yugioh Card prices from tcgplayer.com using BeautifulSoup. When you search for a card on this website, it returns a page of s
Solution 1:
You should use selenium to scrap using real browser:
from selenium import webdriver
driver = webdriver.Chrome('/path/to/chromedriver')
driver.get('http://shop.tcgplayer.com/productcatalog/product/show?newSearch=false&ProductType=All&IsProductNameExact=false&ProductName=%22A%22%20Cell%20Breeding%20Device')
prices = driver.find_elements_by_css_selector('.scActualPrice')
for element in prices:
print(element.text)
driver.quit()
Solution 2:
This website uses a service called Incapsula. The website Developers configured Incapsula to prevent bots from accessing it's content.
I suggest you to contact their admins and request access or ask them for API.
Post a Comment for "Python BeautifulSoup Returning Empty List"