2

using data from this website: https://ourworldindata.org/grapher/total-daily-covid-deaths?tab=map

I am trying to interact with the link 'total-daily-covid-deaths.csv' which has the href link 'blob:https://ourworldindata.org/b1c6f69e-4df4-4458-8aa0-35173733b364'. After clicking on the link I am taken to a page with a lot of data and I am merely trying to write a python script to take that data and put it into a csv file for me to use. While researching this I found that there was an overwhelming amount of information and I got confused very quickly. I have experience web scraping using beautiful soup and requests however I haven't been able to get it working since the blob link isn't an actual website. I was hoping someone could shed some light for me and point me in the right direction.

This is the code I'm using:

import urllib.request as request

url = 'https://ourworldindata.org/grapher/total-daily-covid-deaths?tab=map'
# fake user agent of Safari
fake_useragent = 'Mozilla/5.0 (iPad; CPU OS 6_0 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A5355d Safari/8536.25'
r = request.Request(url, headers={'User-Agent': fake_useragent})
f = request.urlopen(r)

# print or write
print(f.read())
Finn Formica
  • 86
  • 1
  • 7

1 Answers1

0

blob urls are already explain in below url.
Convert blob URL to normal URL

Can you share your code-snippet to get a better idea about your problem.

Nandan Rana
  • 539
  • 3
  • 12
  • 1
    the code gives me the headings and stuff within the javascript but im not sure how to open the Blob URL still – Finn Formica Apr 12 '20 at 16:31
  • It states that data doesn't come from server using blob url. It fetch data from browser memory. If you want to fetch data from such url using python script better to use python selenium. – Nandan Rana Apr 12 '20 at 17:19