RE匹配pdfURL地址
import restr = """
<script language="javascript" type="f9d183f87da800c789dfdf6d-text/javascript">location.href="https://www.agialpress.com/articles/cellular-mechanisms
-of-oestrogen-in-breast-cancer-development.pdf";</script><script src="https://ajax.cloudflare.com/cdn-cgi/scripts/7089c43e/cloudflare-static/rocket-loader.min.js"
data-cf-settings="f9d183f87da800c789dfdf6d-|49" defer=""></script>
"""
regular = re.findall("(http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*,]|(?:%[0-9a-fA-F][0-9a-fA-F]))+pdf)|([a-zA-Z]+.w+.+[a-zA-Z0-9/_]+pdf)",str)
如果是匹配url地址则用
regular = re.findall(r"(http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*,]|(?:%[0-9a-fA-F][0-9a-fA-F]))+)|([a-zA-Z]+.w+.+[a-zA-Z0-9/_]+$)",str)
以上是 RE匹配pdfURL地址 的全部内容, 来源链接: utcz.com/z/537953.html