Sign in to follow this  
Followers 0
Tempest

How do I extract a URL from page source?

5 posts in this topic

Hey everybody,

How can I extract a URL from an email? I tried using StringRegExp and some other stuff, but I couldn't really get it.. :/

I tried using StringMid to step through to get it..but that doesn't really work either, since I can't always know where the characters are gonna start.

So my question is, knowing the beginning and end of the URL...can I somehow extract just the bit I need? Like;

http://www.something.com/blah.php?var=9023...71947&end=0

I could put "?var=" and "&end=0" into a function and get a string equal to the stuff inbetween?

Thanks. :<

Share this post


Link to post
Share on other sites



Ok I got it working, kind of, using a combination of string functions, only problem is, it has '&amp' instead of '&'

:S How can I fix that?

Share this post


Link to post
Share on other sites

StringReplace()

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Ok I got it working, kind of, using a combination of string functions, only problem is, it has '&amp' instead of '&'

:S How can I fix that?

You say you "tried", but you show no "efforts"?
#include <array.au3>
$s_url = "http://www.something.com/blah.php?var=90234832094823094723054719471947&end=0"
$a_regex = StringRegExp($s_url, "(?i)(http.+?var=.+?end=.*?)", 3)
_ArrayDisplay($a_regex)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Thank you guys very much it's working now. :P))

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  
Followers 0