How can I extract all text from a html excluding any css and javascript?
I am trying the following code:
r = requests.get(website)
tree = html.fromstring(r.text)
html_text = tree.xpath('//text()')
But it also retrieves all css and javascript content from the website
<script>and<style>tags?<script>and<style>extracting only all the readable text from the html<script>or<style>?<script>and<style>tags