Home > Blockchain >  Web Scraping Authorization required
Web Scraping Authorization required

Time:10-11

I am trying to web scrape Data I needError I am getting

I want all the the data of response section

CodePudding user response:

You are already getting the correct output at page = requests.get(url, headers=header) and you are printing output of response = requests.get(url) where you are not passing header. Also authorization key does not change here.

You can use the following code to get package and price.

op={}
page = requests.get(url, headers=header)
for d in page.json().get("data"):
    for service in d.get("services"):
        for package in service.get("package_details"):
                op[service.get("name")]=package.get("total")
print(op)

output:

{'Basic Service': 3199, 'Standard Service': 4199, 'Comprehensive Service': 5499}
  • Related