Test if an attribute is present in a tag in BeautifulSoup

后端 未结 6 805
天涯浪人
天涯浪人 2020-12-07 22:01

I would like to get all the

6条回答
  •  一生所求
    2020-12-07 22:42

    you can check if some attribute are present

    scriptTags = outputDoc.findAll('script', some_attribute=True)
    for script in scriptTags:
        do_something()
    

提交回复
热议问题