Get webpage contents with Python?

前端 未结 8 1503
情话喂你
情话喂你 2020-12-04 15:22

I\'m using Python 3.1, if that helps.

Anyways, I\'m trying to get the contents of this webpage. I Googled for a little bit and tried different things, but they didn\

相关标签:
8条回答
  • 2020-12-04 16:08

    If you ask me. try this one

    import urllib2
    resp = urllib2.urlopen('http://hiscore.runescape.com/index_lite.ws?player=zezima')
    

    and read the normal way ie

    page = resp.read()
    

    Good luck though

    0 讨论(0)
  • 2020-12-04 16:09

    Also you can use faster_than_requests package. That's very fast and simple:

    import faster_than_requests as r
    content = r.get2str("http://test.com/")
    

    Look at this comparison:

    0 讨论(0)
提交回复
热议问题