我正在尝试从此link中提取下载链接。
以下是该链接的页面来源(在Google Chrome中查看):
当我指向页面源上的../matlab/licensing.pdf
时,会出现一个链接https://www.mathworks.com/help/pdf_doc/matlab/licensing.pdf
。
我检查了../matlab/licensing.pdf
,但是链接没有出现在右侧。因此,我无法在Python中使用regrex提取此链接。
请帮助我从页面源中提取此链接。
答案 0 :(得分:1)
示例:
import urllib.parse
base = r"https://www.mathworks.com/help/pdf_doc/install/index.html"
link_in_html = r"../matlab/licensing.pdf"
result = urllib.parse.urljoin(base, link_in_html)
print(result)