how to fetch javascript contents in python

前端 未结 1 1482
清酒与你
清酒与你 2021-01-23 15:46

I have a website that has data I want to fetch stored in a javascript. How do I fetch it?

The code is this :- http://pastebin.com/zhdWT5HM

I want to fetch from \

1条回答
  •  遇见更好的自我
    2021-01-23 16:10

    BeautifulSoup would only help locating the desired script tag. Then, you would have multiple options: you can extract the desired data with a javascript parser, like slimit, or use regular expressions:

    import re
    
    from bs4 import BeautifulSoup
    
    page = """
    
    
                                     
                  
提交回复
热议问题