System.Diagnostics.Process.Start("iexplore http://www.site.com")
Using a winform how would you find and click a hyperlink on a page?
Printable View
System.Diagnostics.Process.Start("iexplore http://www.site.com")
Using a winform how would you find and click a hyperlink on a page?
unless you have some way to hook into the external IE process to read the DOM, find the link, and then click on it, I don't know how you would do that.
If you were to host the browser control in WinForms, it can easily be done, because the browser control can expose the DOM to your app, so you can manipulate it. See my signature for an example project on how to do that.
You could just bypass that by requesting the contents of the page using HttpWebRequest, finding the hyperlink you want and calling iexplore to THAT URL!
Using this code i was able to get all the HTML from the site.
Code:Dim pr As New WebProxy
pr.Credentials = CredentialCache.DefaultCredentials
Dim wRequest As Net.WebRequest
Dim wResponse As Net.WebResponse
wRequest = Net.WebRequest.Create(URL)
wRequest.Proxy = pr
wResponse = wRequest.GetResponse
Return New System.IO.StreamReader( _
wResponse.GetResponseStream, _
System.Text.Encoding.GetEncoding("utf-8")).ReadToEnd
Any clue how i would gather the HTML from above and navigate to the URL in the string?Code:<a href="http://www.AAA.com/search/redirect.php?f=http%3A%2F%2Fpagead2.xxxxxxxxx.com%2Fpagead%2Ficlk%3Fsa%3Dl%26ai%3DBmFISjt8UR_z9FpDYoQPl7cSGCqWd4DHtxZvBAsCNtwHgxQgQAhgCIOqdzAMoCjgAUMqOqyVgydbljOSk8BOgAZ_f4f4DsgELY294d2lmaS5jb23IAQHaARNodHRwOi8vY294d2lmaS5jb20vgAIBqAMB6AMN6AP-AugD2gLoA7cC9QNAAQAA%26num%3D2%26adurl%3Dhttp%3A%2F%2Fwww.xxxx.com%26client%3Dca-dp-sedo-04_xml&l=ZjI1MDNkYzg2MGFhOGRlZTQ5NTU5OWI0YWZmYzMzNjEJMC4wNTk5CTQJMTMJMQkwCQkxMAkyCTAJYzU5YTA2NGQwMDIwNTA1MzI0NjUwNzkwNTAyMTU0NjAJd3d3LldpRmkuY29tCTMwMjgzNDczCWMJMTg3ODA4MgkwCTQJZnJlZSB3aWZpCTIzCTEJNQk1OQkwCTAuMDkwMDAwCU4JMAlhMDkyOTVkZjQ3NTA0YjFjYzhjNDNhZGQzODY0NzM0MwkwCTAJMA=="
class="aLink"
target="_blank"
onmouseout="window.status=''"
onmouseover="window.status=''; return true;">www.ABC.com</a>
I looked at your project to manipulate the axWebBrowser. Great functions by the way, i think ill see what i can do to use them. Here is a list of functions that I found in there:Quote:
Originally Posted by kleinma
I don't see a ClickLink function/Procedure just GetLinks. Closest I saw, and this might be workable, but please enlighten me is clickSubmitButton or ClickNormalButton.Code:GetTextboxText()
SetTextareaText(txtData.Text)
GetTextareaText()
ClickNormalButton()
ClickSubmitButton()
GetLinks()
ChangeDIVColor()
ShowPageSource()
ExecuteJavascript()
PrintPage()
GetImageInfo()
GetComboValue()
ClickCheckBox()