I just started with web scraping with Python and hit the wall. I am using the requests library to get the HTML code from a website. For example, the Google search result website: "https://www.google.com/?gws_rd=ssl#q=ball"
When I hit F12 and check the HTML, it looks different than with:
site = requests.get("https://www.google.com/?gws_rd=ssl#q=ball")
print(site.text)
with requests.get
, text is much shorter and not all information is visible (it starts with !doctype
, however).
Because of that I am unable to work with this HTML.
Can you tell me where the mistake is?
This is actually an exercise from the book "Automate the boring stuff with Python". The task is to search for some item Google and then find few first results with HTML locators. I cannot do it because when I use requests.get()
I cannot see any objects for links in the HTML code.