stupid HTML you suck ! HELP PLZ

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
11 posts Page 1 of 2
Contributors
User avatar
lesan101
Top Poster
Top Poster
Posts: 193
Joined: Tue Jun 29, 2010 8:10 am

stupid HTML you suck ! HELP PLZ
lesan101
I want my label3.text to say the number in the red circle below:
Image
offcourse, this is the number for pikachu, so for every pokemon i search
it will show me there number.


but how would it be possible if it does not have an "id"

btw this is on Visual Basic
Image
User avatar
Snyper345
VIP - Donator
VIP - Donator
Posts: 471
Joined: Mon Nov 01, 2010 1:53 am

try adding () around it?
Image
Image
User avatar
lesan101
Top Poster
Top Poster
Posts: 193
Joined: Tue Jun 29, 2010 8:10 am

Snyper345 wrote:
try adding () around it?
where? you need to be more detailed -_-
Image
User avatar
Agust1337
Coding God
Coding God
Posts: 2456
Joined: Fri Feb 19, 2010 8:18 pm

Probable like this, tho I am not good at html lol
Code: Select all
<th>Natioal &#8470;</th>
<td><strong>(025)</strong></td>
I think this is what Snyper means.
Top-notch casual Dating
User avatar
bisnes_niko
Serious Programmer
Serious Programmer
Posts: 409
Joined: Tue Aug 24, 2010 1:21 pm

If you can already grab the html file, then I would do it something like this:

First scan all lines of the html (This way doesn't work incase the <td><strong>25</strong></td> isn't in the beginning)

If the line is starting with the td and strong, make a new variable with that line content

Now, make the variable replace all <td> and <strong> (don't forget the </> ones)

This would make it just be the number

Hope that helped someway... I'm currently at my work and cannot provide any code lol

Edited: Fixed some words...
User avatar
lesan101
Top Poster
Top Poster
Posts: 193
Joined: Tue Jun 29, 2010 8:10 am

Re: stupid HTML you suck ! HELP PLZ
lesan101
Hmm, your idea might seem to work, since thats the number with a "strong" around it, so i guess it should be easy to scan

but yeah, after work please try to see if you can find the version of what your talking about : )
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: stupid HTML you suck ! HELP PLZ
mandai
You can use this:
Code: Select all
        Dim elements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("strong")
        Label3.Text = elements(0).InnerText
User avatar
lesan101
Top Poster
Top Poster
Posts: 193
Joined: Tue Jun 29, 2010 8:10 am

mandai wrote:
You can use this:
Code: Select all
        Dim elements As HtmlElementCollection = WebBrowser1.Document.GetElementsByTagName("strong")
        Label3.Text = elements(0).InnerText
Mandai you are awesome !

i would of never thought about that -__-

but thank you : ))

but lets say it wouldn't have a "strong" around it.. lets say it was this:

Code: Select all
<th>Gender</th> 
					<td><span class="gender-male">50% male</span>,
				<span class="gender-female">50% female</span></td> 
			</tr> 
how would i display the "50%male" part in a label ?
Image
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

Re: stupid HTML you suck ! HELP PLZ
mandai
You can use similar code to the above, just change it to GetElementsByTagName("span").
User avatar
lesan101
Top Poster
Top Poster
Posts: 193
Joined: Tue Jun 29, 2010 8:10 am

mandai wrote:
You can use similar code to the above, just change it to GetElementsByTagName("span").
I fiqured it was something like that

but the thing is, "span" is used for the once. so how would i get it to find the right "span" ??

is it possible to locate it by line ?
Image
11 posts Page 1 of 2
Return to “Tutorial Requests”