G
G
George2018-10-09 19:10:22
Python
George, 2018-10-09 19:10:22

How to parse data from a script tag in python?

There is a tag with text that I have to get. I'm using the bs4 library and can't seem to figure out how I can finally get the content. Here's where I should parse:<div>...<div/>

'<script type="text/javascript">document.write('<div class="b-post__price b-post__price_padleft_10 b-post__price_padbot_5 b-post__price_fontsize_13 b-post__price_float_right"> По договоренности </div>');</script>, <script type="text/javascript">document.write('<div class="b-post__body b-post__body_padtop_15 b-post__body_overflow_hidden b-layuot_width_full"> <div class="b-post__txt "> разработать ПО для windows для записи видеоклипов по аналогу танцующие головы, dance heads итд. ПО должна работать с хромакеем и с фотоаппаратом canon в режиме видеосьемки.... </div>.... <script/>'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Statkevich, 2018-10-10
@hatepls

You look at what requests.text returns to you in the console, you will be unpleasantly surprised
requests does not execute js, therefore, either use full-fledged selenium browser emulation to load the page with all the scripts, or not at all

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question