What is the practical difference between these two ways of making web connections in Python?
- 阅读更多 关于 What is the practical difference between these two ways of making web connections in Python?
I have notice there are several ways to iniciate http connections for web scrapping. I am not sure if some are more recent and up-to-date ways of coding, or if they are just different modules with different advantages and disadvantages. More specifically, I am trying to understand what are the differences between the following two approaches, and what would you reccomend? 1) Using urllib3: http = PoolManager() r = http.urlopen('GET', url, preload_content=False) soup = BeautifulSoup(r, "html.parser") 2) Using requests html = requests.get(url).content soup = BeautifulSoup(html, "html5lib") What