a=os.popen("curl https://ctftime.org/event/list/upcoming") #使用a接收返回值
#print(a.readlines())
for key in a.readlines():
pattern0 = r'(.*) teams will participate'
pattern1 = r'<tr><td><a href="/event/.*">(.*)</td><td>Jeopardy</td><td>'
a1 = re.findall(pattern0,key)
if len(a1) >0:
print(a1)
a2 = re.findall(pattern1,key)
if len(a2) >0:
print(a2)
曹佬见了必捶我系列
为何不用bs4:
- 因为request的时候直接403了,试图session.request失败后,加上鄙人一点爬虫经验都不会,连个模拟鼠标点击也搞不定
所以被迫执行系统命令
学到了os.popen , 6!
找个时间再找曹佬交流探讨一下,希望能学会正规的爬虫,别写三年级脚本了