哈喽 我又把老师的方法放弃了 人生苦短~
Topic sourceTraceback (most recent call last): File "test.py", line 529, in <module> print(soup.section.text) AttributeError: 'NoneType' object has no attribute 'text'
- 1
Traceback (most recent call last): File "test.py", line 529, in <module> print(soup.section.text) AttributeError: 'NoneType' object has no attribute 'text'
司马迁迁迁
#首先复制源代码到本地文件test.html.
#下面是代码部分:
#下面是输出结果: from the Python Events Calendar
Upcoming Events More
PyOhio 2017
29 July – 31 July 2017 Columbus, Ohio, USA
PyCon AU 2017
03 Aug. – 09 Aug. 2017 Melbourne Convention and Exhibition Centre, 1 Convention Centre Pl, South Wharf VIC 3006, Australia
PyCon KR 2017
12 Aug. – 16 Aug. 2017 COEX 513, Yeongdong-daero, Gangnam-gu Seoul 06164, Republic of Korea
PyCon Amazônia 2017
12 Aug. – 14 Aug. 2017 Manaus, Amazonas, Brazil
DjangoCon US 2017
13 Aug. – 19 Aug. 2017 Spokane, WA, USA
PyCon PL 2017
17 Aug. – 21 Aug. 2017 Hotel Ossa Congress & SPA, Ossa, Poland
You just missed...
SciPy 2017
10 July – 15 July 2017 Austin, TX, USA
EuroPython 2017
09 July – 17 July 2017 Rimini, Italy
#输出结果是字符串,所以可以随意编辑。OVER。