Registrations Closing Soon for DevOps Certification Training by CloudxLab | Registrations Closing in

  Enroll Now

Scraping Wikipedia Page - Adding browser agent string

In this step we will set the browser agent string. A browser agent string helps identify which browser is being used, what version, and on which operating system.

You can get your browser agent string from here:

https://udger.com/resources/online-parser

We need a browser agent here so that when a request is sent to a web page, it "thinks" that the request came from a browser and not a Python program. So the web page returns the same information to our program that it would return to a web browser.

INSTRUCTIONS
  • Set the browser agent string in the user_agent variable:

    <<your code goes here>> = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'
    

No hints are availble for this assesment

Answer is not availble for this assesment


Note - Having trouble with the assessment engine? Follow the steps listed here

Loading comments...