Beautifulsoup的find_all方法怎样过滤掉gif,png图,我只要jpg图

finer 2018-01-06 10:22:55
大咖们!
Beautifulsoup的find_all方法怎样过滤掉gif,png图,我只要jpg图
soup.find_all('img',src='(.*?)jpg')
...全文
587 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
finer 2018-01-10
  • 打赏
  • 举报
回复
关注人太少,结贴。 自己解决了。
finer 2018-01-10
  • 打赏
  • 举报
回复
imgs=soup.find_all('img',src=re.compile('.*?jpg'))
finer 2018-01-06
  • 打赏
  • 举报
回复
引用 1 楼 oyljerry 的回复:
你结尾是jpg过滤就可以了
用什么方法呢?
oyljerry 2018-01-06
  • 打赏
  • 举报
回复
你结尾是jpg过滤就可以了

37,743

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • WuKongSecurity@BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧