I'm trying to extract data from socks-proxy.net with the IP and port from the website table.
I'm using these commands in linux to get the IP and port. How can I combine theme?
wget -q -O - "https://socks-proxy.net" | xmllint --html --xpath "//table[@id=\"proxylisttable\"]//tr//td[1]//text()" - 2>/dev/null
Output:
103.254.12.3393.12.55.94192:12:44:11
It combines the IP and it its not good
that will get all the IP's from the website table
wget -q -O - "https://socks-proxy.net" | xmllint --html --xpath "//table[@id=\"proxylisttable\"]//tr//td[2]//text()" - 2>/dev/null
that will get all the ports
Output:
108025951082
It combines the port and its not good.
Question: how can I combine them with the desired example output:
103.254.12.33:1080
93.12.55.94:2595
192:12:44:11:1082
and so on...
A bit late, but seeing you're using 4(!) different tools to accomplish something so simple I just had to jump in to show you another amazing XML parser, called Xidel, which can do it all by itself:
Complex solution:
The output:
Extended approach to cover additional fields:
The output:
P.S. Tested on your input file given by https://pastebin.com/F14VRNBc.