BeautifulSoup 识别 正则 标签属性

herf = soup.find_all(href=re.compile("&id=" + "1013"))
soup = BeautifulSoup(cont, "lxml")

isNextpage = a['href']、

herf = soup.find_all(href=re.compile("&id=" + "1013"))[0]['href']

正则:
m = r'vk=[^&]+'
result = soup.find_all(href=re.compile(m))

posted @ 2017-12-21 13:02  falali009  阅读(1115)  评论(0编辑  收藏  举报