List1.additem "Email: " & strEmail
I use the same format for other tasks just like this in my script, but for some reason, this one is not adding my strEmail to my list, any suggestions? Thank you in advance!
My Code:
Code:Dim strEmail As String strHTML = wrapper.Request("GET", "http://www.neopets.com/email_change.phtml", "http://www.neopets.com/userinfo.phtml") strEmail = GetStringBetween(strHTML, "size=""""30"""" maxlength=""""60"""">", "</td>") List1.AddItem ("Email: " + strEmail)
Page Source
Code:<td><input type="hidden" name="old_email" value="[email protected]" size="30" maxlength="60">[email protected]</td>
List1.additem "Email: " & strEmail
Thanks, but it still does not show the email :/
Ok then something is wrong with your GSB.
Use.
strEmail = GetStringBetween(strHTML, "60" & Chr(34) & ">", "")
Output: size=""30"" maxlength=""60"">Code:Debug.Print "size=""""30"""" maxlength=""""60"""">"
Try this:
It is ok to use "+" for (you need an account to see links) but in visual basic we use "&" (or some of us use Mid$ )Code:Dim strEmail As String strHTML = wrapper.Request("GET", "http://www.neopets.com/email_change.phtml", "http://www.neopets.com/userinfo.phtml") strEmail = GetStringBetween(strHTML, "size=""30"" maxlength=""60"">", "</td>") List1.AddItem ("Email: " & strEmail)
The & operator is recommended for string concatenation because it is defined exclusively for strings and reduces your chances of generating an unintended conversion.
Take out the quotes
Source will beCode:strHTML = Replace(strHTML, """", "")
Then useCode:<td><input type=hidden name=old_email [email protected] size=30 maxlength=60>[email protected]</td>
Code:strEmail = GetStringBetween(strHTML, "maxlength=60>", "</td>") List1.additem "Email: " & strEmail
Why: Faster, especially when there are a lot of concatenations.
How: (you need an account to see links)
(you need an account to see links)