2021年3月10日星期三

Wayfair product prices

I'm not sure if there's an API for this but I'm trying to scrape the price of certain products from Wayfair.

I wrote some python code using Beautiful Soup and requests but I'm getting some HTML which mentions Our systems have detected unusual traffic from your computer network.

Is there anything I can do to make this work?

import requests  from bs4 import BeautifulSoup     headers = {       'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/601.3.9 (KHTML, like Gecko) Version/9.0.2 Safari/601.3.9'   }     def fetch_wayfair_price(url):      response = requests.get(url, headers=headers)      soup = BeautifulSoup(response.content)      print(soup)      fetch_wayfair_price('https://www.wayfair.ca/furniture/pdp/mistana-katarina-5-piece-extendable-solid-wood-dining-set-mitn2584.html')  
https://stackoverflow.com/questions/66575137/wayfair-product-prices March 11, 2021 at 09:14AM

没有评论:

发表评论