I'm going to create a tool which displays webpage rank in VB.NET.
For that I use
Dim str As String = New WebClient().DownloadString(("http://www.alexa.com/siteinfo/" + TextBox1.Text))
And I just want the Global Rank of that url which I provided in textbox1.text
Like here, I provide example.com to check its Alexa global rank:
I just need to display the global ranking number in my VB form.
Plz take a look at this:
On my computer answer is
This code need better error handling but I guess it is ok as a proof of concept.
UPD. Some words on how it works:
The code above uses regular expressions (please take a look at this link to get started) to parse web page and extract the values you need.
On the screenshot you provided one can see that the ranks are stored in html
<a>
tag, which I identify by its href attribute, since it is the only<a>
tag on the page, whosehref
attribute starts with string "/siteowners/certify". Hence, my regular expression matches for inner text of that tag and extracts it into match group.