提取出来的url是列表里的元素,每个元素加起来才是完整的url,有大神帮忙么。。
来源:1-1 python分布式爬虫打造搜索引擎简介
AH7809801
2021-05-21
my_str = ‘’’
‘’’
re.findall(‘url +=(.*)’,my_str)
写回答
2回答
-
bobby
2021-05-22
我没太懂你的意思,你是要多行匹配吗?正则表达式默认匹配到换行符就不往后匹配了 dotall = re.compile(pattern, re.DOTALL)
022021-05-24 -
AH7809801
提问者
2021-05-21
my_str = ''' <meta content="always" name="referrer"> <script> (new Image()).src = 'https://weixin.sogou.com/approve?uuid=' + 'fa19aa76-3477-4f63-81a7-e1ab927efe4a' + '&token=' + '5ACCCF0F96457F48E6E2246189745BFAE702D56160A63434' + '&from=inner'; setTimeout(function () { var url = ''; url += 'http://mp.w'; url += 'eixin.qq.co'; url += 'm/s?src=11&'; url += 'timestamp=1'; url += '621505034&v'; url += 'er=3080&sig'; url += 'nature=66kE'; url += '3FmQ04OFZvV'; url += 'iIEe0kzfug2'; url += 'AFp7HCryJI8'; url += 'cF31uhAqprwIHQARrwnOlWWXggOPaN8RBpOQFRO19NMem7SDGtgNsgOnaDjZRt8ew*YbNbCPA30mkk-k33skmkP6UC5&new=1'; url.replace("@", ""); window.location.replace(url) },100); </script> '''
00
相似问题