Home  >  Q&A  >  body text

python - 用BeautifulSoup如何提取data-lazy-src属性?

<img alt="看图猜国籍啦~" src-src="http://wx4.sinaimg.cn/mw600/7... src="http://www.xrr.com/wp-content...

用BeautifulSoup如何提取src-src属性?
我提取src用['src']可以直接提取,用['src-src']就不行了,搞了一个早上都不行,烦~

阿神阿神2741 days ago810

reply all(1)I'll reply

  • 天蓬老师

    天蓬老师2017-04-18 10:33:02

    img['src-src']

    I tried it and it can be extracted. Are you sure it is in your source code? Maybe it is loaded asynchronously

    reply
    0
  • Cancelreply