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
Back To Top
Search