- Python Web Scraping Cookbook
- Michael Heydt
- 116字
- 2021-06-30 18:43:56
Getting ready...
In this recipe, we will scrape the upcoming Python events from https://www.python.org/events/pythonevents. The following is an an example of The Python.org Events Page (it changes frequently, so your experience will differ):

We will need to ensure that Requests and Beautiful Soup are installed. We can do that with the following:
pywscb $ pip install requests
Downloading/unpacking requests
Downloading requests-2.18.4-py2.py3-none-any.whl (88kB): 88kB downloaded
Downloading/unpacking certifi>=2017.4.17 (from requests)
Downloading certifi-2018.1.18-py2.py3-none-any.whl (151kB): 151kB downloaded
Downloading/unpacking idna>=2.5,<2.7 (from requests)
Downloading idna-2.6-py2.py3-none-any.whl (56kB): 56kB downloaded
Downloading/unpacking chardet>=3.0.2,<3.1.0 (from requests)
Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB): 133kB downloaded
Downloading/unpacking urllib3>=1.21.1,<1.23 (from requests)
Downloading urllib3-1.22-py2.py3-none-any.whl (132kB): 132kB downloaded
Installing collected packages: requests, certifi, idna, chardet, urllib3
Successfully installed requests certifi idna chardet urllib3
Cleaning up...
pywscb $ pip install bs4
Downloading/unpacking bs4
Downloading bs4-0.0.1.tar.gz
Running setup.py (path:/Users/michaelheydt/pywscb/env/build/bs4/setup.py) egg_info for package bs4
推薦閱讀
- 網(wǎng)絡(luò)協(xié)議工程
- 物聯(lián)網(wǎng)(IoT)基礎(chǔ):網(wǎng)絡(luò)技術(shù)+協(xié)議+用例
- GPS/GNSS原理與應(yīng)用(第3版)
- 5G承載網(wǎng)網(wǎng)絡(luò)規(guī)劃與組網(wǎng)設(shè)計(jì)
- Learning QGIS 2.0
- Web Application Development with R Using Shiny
- 物聯(lián)網(wǎng)時(shí)代
- Mastering JavaFX 10
- 物聯(lián)網(wǎng)通信技術(shù)
- 智慧光網(wǎng)絡(luò):關(guān)鍵技術(shù)、應(yīng)用實(shí)踐和未來演進(jìn)
- 圖解手機(jī)元器件維修技巧
- CCNP TSHOOT(642-832)認(rèn)證考試指南
- React Cookbook
- 物聯(lián)網(wǎng)場景設(shè)計(jì)與開發(fā)(初級(jí))
- 從實(shí)踐中學(xué)習(xí)手機(jī)抓包與數(shù)據(jù)分析