from urllib.request import urlopen
from bs4 import BeautifulSoup
import re
html = urlopen
bsObj = BeautifulSoup(html, "html.parser")
for link in bsObj.find("div", {"id":"main_container"}).findAll("a", href=re.compile:
if 'href' in link.attrs and not('class' in link.attrs):
print(link.string)
print(link.attrs['href'])
print("--------------------------------------------------------------")
运行结果:
[置顶]解决adb server端口被占用的问题