<a onclick="xxx(1)">xxxx</a>
类似如上这种需要点击一下才会打开一个网页的,这种链接该如何获取呢?除了手工分析参数自己构造请求, selenium 定位模拟点击,还有什么方法么?
光阴似箭催人老,日月如移越少年。
If the js is obfuscated or encrypted and the link cannot be obtained directly from the code, then only simulated clicks can be done.
from bs4 import BeautifulSoup as bs for a_tag in bs(html_body,'html.parser').find_all('a'): print(a_tag['onclick'])
Regular expression extraction
If the js is obfuscated or encrypted and the link cannot be obtained directly from the code, then only simulated clicks can be done.
Regular expression extraction