skip to Main Content

Beatifulsoup output is Json not HTML, so I cannot parse it using .find methods of bs4

I'm trying to scrape this site. I used the following code: import requests import json from bs4 import BeautifulSoup api_url ='https://seniorcarefinder.com/Providers/List' headers= { "Content-Type":"application/json; charset=utf-8", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0"} body_first_page={"Services":["Independent Living","Assisted Living","Long-Term Care /…

VIEW QUESTION

Navigate in JSON with nultiple keys

I'm trying to get a key from a JSON from a website using the following code: import json import requests from bs4 import BeautifulSoup url = input('Enter url:') html = requests.get(url) soup = BeautifulSoup(html.text,'html.parser') data = json.loads(soup.find('script', type='application/json').text) print(data) print("####################################")…

VIEW QUESTION

Average price of scraped item on ebay using python

How can I get the average price from a list of scraped items' prices from ebay? This is my code: from urllib.request import Request, urlopen from bs4 import BeautifulSoup import requests from requests_html import HTMLSession link = "https://www.ebay.co.uk/sch/i.html?_from=R40&_trksid=p2334524.m570.l1313&_nkw=5035224123933&_sacat=0&LH_TitleDesc=0&_odkw=EAN5035224123933&_osacat=0" req =…

VIEW QUESTION
Back To Top
Search