【发布时间】:2013-01-08 15:59:34
【问题描述】:
我正在开发第 3 方应用程序,我已经阅读了网页源内容的视图。从那里我们只需要收集一些 href 内容值,其模式类似于 /aems/file/filegetrevision.do?fileEntityId。可能吗?我的一个给了我所有的href 值。
HTML *(HTML 的一部分)*
<td width="50%">
<a href="/aems/file/filegetrevision.do?fileEntityId=10597525&cs=9b7sjueBiWLBEMj2ZU4I6fyQoPv-g0NLY9ETqP0gWk4.xyz">
screenshot.doc
</a>
</td>
代码
for a in soup.find_all('a', {"style": "display:inline; position:relative;"}, href=True):
href = a['href'].strip()
href = "https://xyz.test.com/" + href
print(href)
谢谢
谢谢,
【问题讨论】:
-
@CRUSADER 是的,我尝试过,但没有成功。供您在上面找到!
标签: python beautifulsoup