|

楼主 |
发表于 2020-6-24 23:24:17
|
显示全部楼层
- import bs4
- import requests
- from lxml import html
- import re
- etree = html.etree
- headers = {"Mozilla":"5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36"}
- url = "https://www.tupianzj.com/meinv/siwa/"
- res = requests.get(url, headers=headers, verify=False)
- res1 = bs4.BeautifulSoup(res.content.decode("gb2312"), "html.parser")
- html = etree.HTML(res1.text)
- print(html)
- img = html.xpath("//ul[@class='list_con_box_ul']/li/a/img/@src")
- print(img)
复制代码 |
|