Visual Basic Code , VB.NET Code, VB Code
  Home   :  Code   :  Forums   :  Submit   :  Mailing List   :  About   :  Contact


Started programming - stuck on these for a week


Started programming - stuck on these for a week









the value="USE D" is a variable that will change but i dont htink it matters

name="submit4221" is a partial variable, the digits at the end can change per page load (wont always)



i've tried about 3 different things, all i can say is submitting a click doesnt seem to accomplish diddly.





Can anyone here give me any tips? I've been at this for over a week and I can't seem to find anything to get me over these hurdles, lots and lots of googling and a forum or two have helped me get this far, but i never seem to get these questions answered



*** actually therse one more noobie question i have, what is the best way to tell your program to wait for webpage1 to finish loading before continuing, WITHOUT coding things directly into the webpage (i don't intend to have it in use and dont want to code directly to it, eventually i want to remove it completely once i get this beta version finished)



I've read a few ways but none seem to be perfect answers
Edited
10/8/2012 by aff219
Author
Message
aff219
aff219
Forum God
Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)

Group: Forum Members
Posts: 2, Visits: 9
Disclaimer: I'm a noob to programming, just got a load of freetime (became self employeed woo!) and decided to learn something I've always wanted to learn. Therefore, I need gentle yet thorough guidance please.



I decided to join a browser based game (name will be left out in all this) and use it as a learning block for this.



I've accomplished quite a lot in my program, but I'm stuck between a rock and a hard place now.



2 big issues I'm having:



Issue 1 - Locating target values and navigating to their assigned URL.



Relevent HTML Code:





USE B 11

open

open

USE C 324

open

USE D 32

open

open

open

open

open







Notes:

the Alt value is able to contain similar and exact terms as each other. For instance, 2 may be "open", some might be "use b 11", some might be "use b 12" etc





What I want:

1.navigate webbrowser1 to the url contained in the first area tag that has an alt with my searched value.



So if I want to find "D", the program will grab

USE D 32

and use its url to navigate in the web browser.



I've had partial success with this with 3 different methods, but all lead to an issue i cant get around so I'm willing to start fresh. The best way ive had yet was with this code:





Dim Items = _

( _

From T In Form2.WebBrowser1.document.GetElementsByTagName("alt").Cast(Of HtmlElement)() _

Where T.GetAttribute("href").ToString.Contains("region.php?reg=") _

Select Link = T.GetAttribute("href"), Text = T.InnerText _

).ToList

ListBox1.Items.AddRange(Items.ToArray)





But frankly I couldn't figure out how to use that information to navigate to URL (It also seemed to pull more than purely the url, instead of JUST the url it would display "url = ********* Text=" and i couldnt figure out how to fix that, nor could I figure out how to use it to navigate the webbrowser to the page it obtained, then while trying for a few hours I somehow managed to break it <.<



2. click a button on the page it navigates to from goal 1 if 2 variables are true

variable 1: if ____ is located in the HTML code

variable 2: if it states "USE 2" & >= predefined number



seems easy enough right? theres tons of guides on the net for this sort of thing, but for lord only knows why, I can't make it work for this site. I can with others, not this one.



relevant HTML (The form/html code for the button):























aff219
aff219
Forum God
Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)Forum God (592 reputation)

Group: Forum Members
Posts: 2, Visits: 9
so, apparently this forum doesn't allow you to post html...



~.~
Keithuk
Keithuk
Forum God
Forum God (304K reputation)

Group: Moderators
Posts: 1.9K, Visits: 5.5K
Welcome to the forum.

aff219 (10/9/2012)
so, apparently this forum doesn't allow you to post html...

It does for me http://www.a1vbcode.com/a1vbcode/vbforums/Default.aspx

Keith

I've been programming with VB for 17 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

GO


Similar Topics


Reading This Topic


Login
Existing Account
Email Address:


Password:


Social Logins

Select a Forum....

















A1VBCode Forums


Search