使用Python BeautifulSoup从证书验证后的网页提取URL
提取证书验证后的目标URL
- 使用
curl搭配你的PEM证书发起认证请求,获取页面完整内容:
替换curl --cert /path/to/your/cert.pem https://目标网站域名/path/to/your/cert.pem为你的PEM文件实际路径,https://目标网站域名替换为图片对应页面的域名。 - 从返回内容中过滤提取目标URL:
用grep直接匹配mis.ercot.com/misdownload开头的链接:curl --cert /path/to/your/cert.pem https://目标网站域名 | grep -o "mis.ercot.com/misdownload[^\"']*" - 若页面是JS动态渲染的,
curl无法抓取动态加载内容,改用Chrome无头模式:
需确保Chrome已配置正确的证书参数,能加载你的PEM文件完成认证。chrome --headless --disable-gpu --certificate-file=/path/to/your/cert.pem --dump-dom https://目标网站域名 | grep -o "mis.ercot.com/misdownload[^\"']*"
内容的提问来源于stack exchange,提问作者Zanam
相关产品推荐
相关产品推荐

