I'm trying to extract the Proxy IP number on the first column in this page (https://www.proxynova.com/proxy-server-list/country-fr/), just the number for example: "178.33.62.155" but when I try to extract all the text content on the relevant tag , it doesn't get the Ip text.
The html tag on the website is:
<td align="left"><script>document.write('23178.3'.substr(2) + '3.62.155');</script>178.33.62.155</td>
Then I believe the Ip number above (after the tag script, inside the tag ) should appears when I print the text content, but it doesn't, following the code below I have done so far the only information that doesn't appears is the IP number.
Any idea on how to extract this specific Ip information and why it is not appearing when I extract all the text content of this tag?
from lxml import html
import requests
import re
page = requests.get('https://www.proxynova.com/proxy-server-list/country-fr/')
tree = html.fromstring(page.content.decode('utf-8'))
for elem in tree.xpath('//table[@class="table"]//tbody//td[@align="left"]'):
print elem.text_content()
country-frin your question text but a URL withcountry-brin your code. Does it make a difference?178.33.62.155is not itself an element; it is the text content of the<td>element.