Jump to content
Sign in to follow this  
cypher175

Parsing WebPages For Proxies ( IP:PORT )..??

Recommended Posts

cypher175

How could I parse this webpage http://proxy-heaven.blogspot.com for proxies..??

I know how to get the webpage source code, I just don't really know of any great way to parse the source data for "IP:Port"

is there some kinda function or something that can collect a string if it matches something like "XXX.XXX.XXX.XXX:XXXXX"

where the "X" stands for a wild card for any number between 0-9....??

Anybody have any good ideas on how to go about doing something like this..??

Share this post


Link to post
Share on other sites
cypher175

anybody have any tips on how i could go about doing this..??

Share this post


Link to post
Share on other sites
Authenticity

#include <Array.au3>

Local $sText = "0ke30ke :oo: 123.123.123.1234:4-4l-4 30.90.60.90:12234"
Local $avMatches = StringRegExp($sText, "((?>(?:[01]?\d?\d|25[0-5]|2[0-4]\d)\.){3}(?:[01]?\d?\d|25[0-5]|2[0-4]\d)):(\d{1,5})", 3)

If IsArray($avMatches) Then _ArrayDisplay($avMatches)

Edit: Meh...

Edited by Authenticity

Share this post


Link to post
Share on other sites
cypher175

#include <Array.au3>

Local $sText = "0ke30ke :oo: 123.123.123.1234:4-4l-4 30.90.60.90:12234"
Local $avMatches = StringRegExp($sText, "((?>(?:[01]?\d?\d|25[0-5]|2[0-4]\d)\.){3}(?:[01]?\d?\d|25[0-5]|2[0-4]\d)):(\d{1,5})", 3)

If IsArray($avMatches) Then _ArrayDisplay($avMatches)

Edit: Meh...

Thanks Authenticity,

It seems to work good, but why does the port get put onto a diff array line..??

how can I extract the "IP:PORT" so its all on one array line like:

123.123.123.123:1080

123.123.123.123:1080

123.123.123.123:1080

123.123.123.123:1080

Share this post


Link to post
Share on other sites
Authenticity

Because of capturing groups, remove them:

StringRegExp($sText, "(?>(?:[01]?\d?\d|25[0-5]|2[0-4]\d)\.){3}(?:[01]?\d?\d|25[0-5]|2[0-4]\d):\d{1,5}", 3)

Share this post


Link to post
Share on other sites
cypher175

thanks, it works great,

so how would I use StringRegExp to extract MAC addresses from a .txt file in a similar way..??

00:00:00:00:00:00

AA:AA:AA:AA:AA:AA

12:34:56:78:90:12

Ect.. Letters A-F Nums 0-9

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.