Python urllib2.urlopen() is slow, need a better way to read several urls

前端 未结 9 2262
谎友^
谎友^ 2020-11-28 04:48

As the title suggests, I\'m working on a site written in python and it makes several calls to the urllib2 module to read websites. I then parse them with BeautifulSoup.

9条回答
  •  生来不讨喜
    2020-11-28 05:06

    As a general rule, a given construct in any language is not slow until it is measured.

    In Python, not only do timings often run counter to intuition but the tools for measuring execution time are exceptionally good.

提交回复
热议问题