SolvedReading Random URL

Posts 1–15 of 15 · Page 1 of 1
Reading Random URL
Ok so in one of my account creators im trying to read a url that has some numbers at the end that change everytime example below, there is a very simple way around this that I used before but I cant remember what it was someone help out a noob

Example:
If WebBrowser1.Url.Equals("www.google.com/35354535") Then
So what do you want to do? I dont get it
Quote Originally Posted by 'Bruno View Post
So what do you want to do? I dont get it
Im trying to read that url but the numbers at the end change everytime, how do i make vb know that it will be http://www.google.com/then random numbers here so it will still find the url.
Remove the numbers...
Split by "/"...
Use Regex...
Quote Originally Posted by 'Bruno View Post
Remove the numbers...
Split by "/"...
Use Regex...
I don't know what you mean?
Quote Originally Posted by silentrunner2 View Post
I don't know what you mean?
I posted 3 possible ways..

Read the full URL and then remove everything if front of "/"
Or..Split the string of the URL by "/"
Or..Use regular expressions
Quote Originally Posted by 'Bruno View Post


I posted 3 possible ways..

Read the full URL and then remove everything if front of "/"
Or..Split the string of the URL by "/"
Or..Use regular expressions
You have lost me
Splitting that can be quite simple.. Here is an example

Dim url as string = "123:456:789"
Dim Options() as string = url.split(":")

Options(0) = 123
Options(1) = 456
Options(2) = 789

What I basically did was split the string into 3 parts, by the ":"
and put them into an array which is Options().
The numbers represent the index of the array

so in your terms, you'll first have to figure out the whole url that you're using. Will it contain just www.google.com/21484ⓘ or http://www.google.com/544354ⓘ
Using the slit method, you'll have to do it the long way.

Thats just one of the ways mentioned by Bruniz.

Theres also replace, removing, trimming or even functions that you can create. Possibilities are endless
LOL!

If WebBrowser1.Url.StartsWith("www.google.com/") Then '(It could be webrowser1.Url.Tostring.startswith("etcetc"), i dont remember.
Quote Originally Posted by Raow View Post
LOL!

If WebBrowser1.Url.StartsWith("www.google.com/") Then '(It could be webrowser1.Url.Tostring.startswith("etcetc"), i dont remember.
Yessssss thats it the second one, thanks buddy new there was a simple way of doing it thanks
or is string.contains("google")
Quote Originally Posted by DawgiiStylz View Post
or is string.contains("google")
Thanks may need that
Quote Originally Posted by DawgiiStylz View Post
or is string.contains("google")
Buttttttt, what if theres other sites that contain google. like blog posts, etc. that would pick those urls up then.
Quote Originally Posted by Raow View Post
Buttttttt, what if theres other sites that contain google. like blog posts, etc. that would pick those urls up then.
your solution isnt great either.. It may contains Http://, it may not... etc
Quote Originally Posted by 'Bruno View Post


your solution isnt great either.. It may contains Http://,ⓘ it may not... etc
Ah. i see. and google has https:// as well. hmmm. well, i like my idea the best.
Posts 1–15 of 15 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?