Python text parsing between two words

后端 未结 1 1412
青春惊慌失措
青春惊慌失措 2021-01-24 18:49

I\'m using beautifulsoup and want to extract all text from between two words on a webpage.

Ex, imagine the following website text:

This is the text of t         


        
相关标签:
1条回答
  • 2021-01-24 19:25

    since you're just parsing the text you just need the regex:

    import re
    result = re.findall("text.*?bunch", text_from_web_page)
    
    0 讨论(0)
提交回复
热议问题