0
<script type="text/javascript">
document.location = 'content_that_I_want_to_parse';
</script>

it is simple but I couldn't find something like this as most of questions were made for json

could someone guide me how to parse this?

page = s.get('http://theaddress.com')
soup=bs(page.text,'html.parser')
result = soup.find('script'}.get('value')

the result i want is as below

content_that_I_want_to_parse
1
  • document.location = (some_regex) might work better if that's all you're interested in Commented Nov 26, 2018 at 2:56

1 Answer 1

1

Here, tested: print(soup.script.text)

Sign up to request clarification or add additional context in comments.

1 Comment

the result is 'document.location = content_that_I_want_to_parse' how do i get 'content_that_I_want_to_parse' only?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.