[Python] Python - Get HTML Source Code of a Web Page

Discussão em 'Python' iniciado por Stack, Maio 18, 2025.

  1. Stack

    Stack Membro Participativo

    I want to get the HTML source from a site ('example.com' for example).

    I tried the following:

    import urllib2

    response = urllib2.urlopen("https://example.com")
    page_source = response.read()


    It says:


    'No module named urllib2'
    ​

    How can I prevent this error?

    Continue reading...

Compartilhe esta Página