If I were using 2003 I wouldn't have any problems. Welcome to the World of 2007. If I figure it out I will post back..
Printable View
If I were using 2003 I wouldn't have any problems. Welcome to the World of 2007. If I figure it out I will post back..
ok thats definitely my problem. I found a sub ruitine that Pauses for given amount of time, so i made it pause for 10 seconds, and it works!
Except, thats not a very reliable way of doing it in case the page takes a longer time to load for some reason.
how can i just have it check that the page is done and completely loaded?
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
FYI. My toolbox in Access is greyed out and I can't get to it..Seems like there's lots of others in my situation out there...Code:With WebBrowser1
.Document.Forms(0).All("txtResID").focus
.Document.Forms(0).All("txtResID").Value = "blah blah"
End With
End Sub
ok it definitely works now.
to make it wait i used:
but now i need to figure how to click the "submit" button on the page. How do i go about that?Code:Do Until webbrowser1.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
I'm trying to use the "Check if word/string is found on page" code on the first page of this thread, but keep getting an Error 91 message on this line:
First i got an object not defined error because "webBrowser1" wasnt Dim'd, so i dim'd it as "Dim webBrowser1 as webbrowser" but now i need to SET it to something - i just dont know what i SET it to. Anyone know?Code:For i = 1 To WebBrowser1.Document.All.length
I realize this may sound odd...but can the Webbrowser Control be embedded in a HTML page? If so how would I do it?
I'm building a Folder Home Page to replace my Outlook Today and would like to be able to use it as a file browser right on the page.
Use an iframe element.Quote:
Originally Posted by dch31969
Ok...I know how to put an iframe into a HTML page, but given that I had no idea until yesterday that the WebBrowser control existed, could you please provide me with the syntax? I should be able to figure things out from there.Quote:
Originally Posted by penagate
sorry, I didn't mean embed the WebBrowser using an iframe, but just point the iframe to the directory you want to browse.
So its not possible to present an Explorer like interface complete with folders, drives, files? I'm essentially looking give my users everything that they have when they explore their PCs.Quote:
Originally Posted by penagate
That auto submit thing is good With WebBrowser but how do u find the exact Thing to be written like. If i do it on. http://login.yahoo.com Then if i view html code for this page i see Document.Write. So I write it like this
WebBrowser1.Document.Write.passwd.value = strpw
passwd is PASSWORD so it doesnt work :mad:
Nvm It Works Thanks For The Help By msgjp7
Hi, if you know, I need some codes! For the find box (when I start the find box and start searching a word, I want webbrowser to highlight it). I need codes for the right click menu, such as 'Save Picture As...'; 'E-mail Picture'; 'Print Picture'; 'Set as Background'; 'Set as Desktop Item'; 'Copy Shortcut'; 'Add to favorites'; 'Open link'; 'Open link in new window'; 'Save Target as...'; 'Print Target'. I want to know, if I have open form1, how to open a NEW form1 with a commandbutton? Please help with these problems!
Is there any way to block pop ups.???:)
Here is my current code:
Basically, supposed to replace every Google string with Boogle. Works, as I tested with MsgBox, but the thing is EHTML doesnt writeback to the page, so EHTML is changed, while whats being displayed isn't. Any way to writeback the changes without reloading the page?Code:Option Explicit
Dim doc As HTMLDocument
Private Sub Command1_Click()
WebBrowser1.Navigate "http://www.google.com"
End Sub
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
Dim i As Long, EHTML
For i = 1 To WebBrowser1.Document.All.length
Set EHTML = _
WebBrowser1.Document.All.Item(i)
If Not (EHTML Is Nothing) Then
If InStr(1, EHTML.innerHTML, "Google", vbTextCompare) > 0 Then
Replace EHTML.innerHTML, "Google", "Boogle"
End If
End If
Next i
doc = WebBrowser1.Document
End Sub
Might be bringing an old post back alive but I definately needed help with this. The above code got me started on making my own context menu for the webbrowser control. However, My webbrowser control page that it navigates to has an iframe. When I right click on the iframe it does not keep the contextmenu, is there a way to fix this?Quote:
Custom Right Click Menu
This is an example show how to make your own custom right click menu. in order for this to work you must add the "Must Add Microsoft HTML Object Library" to your refrance.Also make your own custom menu using the menu editor I named my "mnu"
Please Note it will effect all the context menus in the webbrowser.
VB Code:
'Must Add Microsoft HTML Object Library Option Explicit Public WithEvents HTML As HTMLDocument Private Function HTML_oncontextmenu() As Boolean HTML_oncontextmenu = False PopupMenu mnu '<---Check the mnu to your own menu name End Function Private Sub Form_Load() WebBrowser1.Navigate "www.google.com" End Sub Private Sub Form_Unload(Cancel As Integer) Set HTML = Nothing End Sub Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, _ URL As Variant) Set HTML = WebBrowser1.Document End Sub
Thanks,
n3m.
So, does you example work with IFrames?
Nevermind, I see now you stated that. BTW: I have been working on that problem from your other thread and so far no luck but I am sticking with it since I have learned a few things about frames and things since then so maybe, just maybe, I might be able to figure it iut.
Hi. Is there anyway any to get "updated" html code on pages with AJAX? Im working with .net 2008, Webbrowser.
Is there any workarround to solve this?
Thanks.
Ariel
Hi all,
Thanks for the control tips and examples. I'm developing an Outlook-Addin in VB6 and I'm trying to do what is outlined in 'Making page on startup' as listed below. I'm retriving HTML from a database and would like to display it in the webbrowser control.
The problem is that I have no intellisense past WebBrowser1.Document (no .Write). and when I add it, the program errors out.Code:Private Sub Form_Load()
WebBrowser1.Navigate "about:blank"
End Sub
Private Sub Command1_Click()
Dim HTML As String
'----------The HTML CODE GOES FROM HERE AND DOWN----------
HTML = "<HTML>" & _
"<TITLE>Page On Load</TITLE>" & _
"<BODY>" & _
"<FONT COLOR = BLUE>" & _
"This is a " & _
"<FONT SIZE = 5>" & _
"<B>" & _
"programmatically " & _
"</B>" & _
"</FONT SIZE>" & _
"made page" & _
"</FONT>" & _
"</BODY>" & _
"</HTML>"
'----------The HTML CODE GOES HERE AND ABOVE----------
WebBrowser1.Document.Write HTML
End Sub
I have a reference to the Microsoft Internet Controls, but I don't know what is the matter.
Any help would be appreciated.
Thanks,
JB
Here's 2 additions:
Requires MSHTML Object Library and the WebBrowser is called wbMain
Waiting for a webpage to load
Code:cNavAndWait
vb Code:
Option Explicit Private Declare Function GetTickCount Lib "kernel32.dll" () As Long Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long) Private m_bDOMReady As Boolean Private WithEvents m_ctlWB As WebBrowser Public Function navigateAndWait(ByVal ctlWebBrowser As WebBrowser, ByRef vData As Variant, Optional ByRef lMaxWaitTimeMillis As Long = 45000) As Boolean On Error GoTo EH Dim lEndTime As Long, obj As IHTMLElement, szURL As String '--Navigate and wait for the web page to load '--vData can be a string(url) or an HTML Object Set m_ctlWB = ctlWebBrowser If (IsObject(vData)) Then Set obj = vData Select Case UCase(obj.tagName) '--Hyperlink reference, like links on a page Case "A" Call ctlWebBrowser.Navigate(obj.href) '--Forms, like login pages Case "FORM" Call obj.submit '--Something else, so try to click it Case Else Call obj.Click End Select Else '--Regular URL szURL = CStr(vData) Call ctlWebBrowser.Navigate(szURL) End If lEndTime = (GetTickCount() + lMaxWaitTimeMillis) m_bDOMReady = False Do While (Not m_bDOMReady) '--Check for timeout If ((lMaxWaitTimeMillis <> -1) And (GetTickCount() > lEndTime)) Then Exit Do '--So app doesnt freeze DoEvents '--Dont kill the CPU Call Sleep(5) Loop If (Not m_bDOMReady) Then Call m_ctlWB.Stop End If Set m_ctlWB = Nothing navigateAndWait = (m_bDOMReady) Exit Function EH: Call Err.Clear navigateAndWait = False End Function Private Sub m_ctlWB_DocumentComplete(ByVal pDisp As Object, URL As Variant) On Error GoTo EH Dim oHTMLDoc As HTMLDocument '--In pages with no frames, this event fires one time after loading is complete. '--In pages where multiple frames are loaded, this event fires for each frame where the DWebBrowserEvents2::DownloadBegin event has fired. '--The top-level frame fires the DocumentComplete in the end. '--So, to check if a page is done downloading, you need to check if the IDispatch* parameter, is same as the IDispatch of the WebBrowser control. If (pDisp Is m_ctlWB.object) Then m_bDOMReady = True ElseIf (TypeOf pDisp.Container Is HTMLDocument) Then Set oHTMLDoc = pDisp.Container If (oHTMLDoc.frames.length = 0) Then m_bDOMReady = True End If End If Exit Sub EH: Call Err.Clear End Sub
Example:
vb Code:
Private Sub cmdGo_Click() Dim oNAW As cNavAndWait, sStart As Single Set oNAW = New cNavAndWait sStart = Timer() Call oNAW.navigateAndWait(wbMain, txtURL.Text) Call MsgBox(txtURL.Text + " took " + CStr(Timer() - sStart) + " seconds to load.", vbOKOnly Or vbInformation, "Navigate And Wait") Set oNAW = Nothing End Sub
How to copy and save an image from a webpage
vb Code:
Option Explicit Private Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long) Private m_bDOMRdy As Boolean Private Sub cmdCopy_Click() Dim pDoc As HTMLDocument, pImgEle As IHTMLImgElement, pCR As IHTMLControlRange, szImgname As String '--Grab the image of the first picture on the page and copy it into the PictureBox Set pDoc = wbMain.Document For Each pImgEle In pDoc.All.tags("IMG") szImgname = Mid(pImgEle.src, InStrRev(pImgEle.src, "/") + 1) '--Create a control range '--MSDN: Contains a range of control type elements that is used for control selection; _ and represents an array of controls that can be operated on as a group. Set pCR = pDoc.body.createControlRange() '--Clear the clipboard Call Clipboard.Clear '--Add the image element Call pCR.Add(pImgEle) '--Copy it to the clipboard Call pCR.execCommand("copy") '--Do what you want with the image since its on the clipboard Set pbPic.Picture = Clipboard.GetData(vbCFBitmap) '--Save the image Call SavePicture(pbPic.Picture, "C:\" + szImgname) Exit For Next pImgEle End Sub Private Sub Form_Load() m_bDOMRdy = False Call wbMain.Navigate("http://frontrowcrew.com/") Do While (Not m_bDOMRdy) DoEvents Call Sleep(10) Loop End Sub Private Sub wbMain_DocumentComplete(ByVal pDisp As Object, URL As Variant) If (pDisp Is wbMain.Object) Then m_bDOMRdy = True End If End Sub
How can I make my webbrowser remember any password and username i enter?
What do you mean by webbrowser? Are you talking about an application webbrowser like IE or FireFox or are you talking about the webbrowser control that you use in a VB program? If it's the control you do not make it remember passwords/usernames. This you must do yourself with some sort of external file or database.
I mean the webbrowser control. I can save my passwords in a file, but how can I make the WebBrowser control detect when I login to a page??
You can't in the strict sense of making the browser detect the login. You need to control the page that you are logging into in you VB program. By using the DocumentComplete event of the WebBrowser control you can determine if the current document (or page) is the login page. You have to be familiar with this page (i.e. you need to know it's URL and the names of the fields on the page that are used to enter the username and passwords). Once you know you have this page loaded and the names of the two fields you simply copy the username and password from your file into these two fields and then you must also know the name of the submit button so you can programmaticly "click" on the submit button.
Let's say, for example, I want to automate a login to a website. In an external file I would keep the usernames and passwords. Now let's also say I know exactly the URL of the page that has the username and password fields on it and also the login button. So, for this example, the URL of the page is "http://www.jmswebsite.com/loginpage" and the names of the fields on this page are "userID" and "pass" for the username and password and "login" for the submit button.
Here is a very simple code example of the above.
This example may not exactly solve your problem but it shows the very basics of one way you might approach your problem.Code:Private Sub WebBrowser_DocumentComplete(ByVal pDisp As Object, URL As Variant)
'
'
If URL = "http://www.jmswebsite.com/loginpage" Then
WebBrowser.Document.All("userID").Value = username from your external file
WebBrowser.Document.All("pass").Value = password from your external file
WebBrowser.Document.All("login").Click
End If
'
'
End Sub
You helped me a lot. Thank you. If I manage to solve my problem I will post the code here!!!
Now I have another question. I can't explain it in words but I will show you an exampple:
I have http://www.vbforums.com/showthread.php?t=384076&page=3 and I want to have this: http://www.vbforums.com/ . How can I do this?? (I want it for the favicon)
You can use small tip:
vb Code:
Private Sub Form_Load() WebBrowser1.Navigate "http://www.vbforums.com/showthread.php?t=384076&page=3" End Sub Private Sub WebBrowser1_DownloadComplete() Dim i As Integer Dim SearchString Text1.Text = WebBrowser1.LocationURL SearchString = Text1.Text ' String to search in. SearchChar = ".com" ' Search for "Xp". i = InStrRev(SearchString, SearchChar, , 1) 'InstrRev(stringcheck, stringmatch[, start[, compare]]) Text2.Text = Left(Text1.Text, (i + 3)) End Sub
i tried the 'Custom Right Click Menu' side of the tutorial
but is not working and i don't know why.
am using windows Vista, has it got something to do with it.
my Question is
how can i copy image in web browser control programatically
for example web page which i have loaded into web browser control have got 5 images and if i can right click on each image and save it is alowing me to do it manually but i want to do this autometacally
and i just want to save one image from the page may be this is first image or mid image or last image
how to control the download window
say we browse to http://go.microsoft.com/?linkid=9729747
then it will come up with a save file prompt
we save it
so I want to be able to see if the download is finish or not..
thank you
This is a great post! I have a specific question a little on the advanced side of this topic. I am trying to save "specific" data from the website to tables in access. Here is a small portion of the web site I am dealing with.
I am currently pulling the data using the website control and using this code here to put it into a string but have no idea which way to go now...Code:<div class="details">
<span id="Quals" onclick="javascript: toggleTable(this.id)" class="OutlineIcon">
<img id="imgQuals" src="images/minusIcon.gif" border="0" WIDTH="14" HEIGHT="14"></span>
<span class="detailsHd">ATMS Quals</span>
<table id="tblQuals" border="1" cellpadding="2" cellspacing="0" class="details">
<tr><th>Qual Number</th>
<th>Title</th>
<th>Expires</th></tr>
<tr><td align="left" valign="top" class="Normal">
ADM_MAT </td>
<td align="left" valign="top" class="Normal">
<a href="atms_supv_qualtree.cfm;jsessionid=0e30e09a3ccb91f2c5ca5e806e7d2b2d6176?PID=22644&qualcat=ADM&qualid=_MAT&title=MANDATORY ANNUAL TRAINING" class="Normal">MANDATORY ANNUAL TRAINING </a></td>
<td align="center" valign="top" class="Normal">
10/31/2011 </td></tr>
<tr><td align="left" valign="top" class="Normal">
BASSHIP_WORKER </td>
<td align="left" valign="top" class="Normal">
<a href="atms_supv_qualtree.cfm;jsessionid=0e30e09a3ccb91f2c5ca5e806e7d2b2d6176?PID=22860&qualcat=BAS&qualid=SHIP_WORKER&title=BASIC SHIPBOARD WORKER" class="Normal">BASIC SHIPBOARD WORKER </a></td>
<td align="center" valign="top" class="Normal">
10/31/2011 </td></tr>
<tr><td align="left" valign="top" class="Normal">
BASSHOP_WORKER </td>
<td align="left" valign="top" class="Normal">
<a href="atms_supv_qualtree.cfm;jsessionid=0e30e09a3ccb91f2c5ca5e806e7d2b2d6176?PID=22861&qualcat=BAS&qualid=SHOP_WORKER&title=BASIC SHOP WORKER" class="Normal">BASIC SHOP WORKER </a></td>
<td align="center" valign="top" class="Normal">
10/31/2011 </td></tr>
Thanks allCode:Dim teststring As String
teststring = WebBrowser1.Document.body.innerhtml
@thechazm: For gathering data from table (of HTML), dilenette had posted a sample code that uses ADO to retrieve the information. If you search the forum, you'll find that code. :wave:
Thank you for pointing me in the right direction. The name you referenced though does not seem to be listed in the user directory so I'm just scanning the net now.
Have a good one,
TheChazm
That's because his handle is spelled dilettante
Thanks again. I was able to figure out what I needed by reading http://www.devarticles.com/c/a/HTML/...s-a-Recordset/
I will go read what dilettante posted to maybe get more in depth information but the code was as simple as this:
Thanks again so very much for the responces and help,Code:AtmsQualsNumber = WebBrowser1.Document.getelementbyid("tblQuals").rows(AtmsQualsc).cells(AtmsQualscc).innertext
TheChazm
and how can i get text from webbrowser to my form in vb6
After a very long time of spending working with the webbrowser control I have learned quite a bit as far as how to make it work. Now I think I have hit another stump. I am trying to read a table with no id on a page. The page only has one table on it but I cannot seem to get the code to pickup on it. Any suggestions?
Here is what I have so far:
And I have also tried:Code:AtmsQualsLength = WebBrowser1.Document.getElementsByTagName("table").rows.length
The reason why I am putting table as the table name is because of this postCode:AtmsCoursesLength = WebBrowser1.Document.getelementbyid("table").rows.length - 1
http://www.eggheadcafe.com/software/...lass-name.aspx
Thanks to all
Well I was not able to ever find a good solution for reading a table with no ID instead I used the instr function and with some calculations read the data from its source code. Its a pain and if the format changes then I would have to update the code but here is what I have.
I just wanted to share what I have done so hopefully its usefull to someone.Code:'// Locate and assign Pay Shop
lngSupCode = InStr(WebBrowser1.Document.documentelement.innerhtml, "Pay Shop")
lngSupCode = lngSupCode + 210
strBuildData = Mid(WebBrowser1.Document.documentelement.innerhtml, lngSupCode)
lngSupCode = InStr(strBuildData, " ")
strBuildData = Left(strBuildData, lngSupCode)
strBuildData = Mid(strBuildData, 18)
lngSupCode = InStr(strBuildData, "&") - 1
strBuildData = Left(strBuildData, lngSupCode)
strPayShop = strBuildData
'// Locate and assign Assn'd Shop
lngSupCode = InStr(WebBrowser1.Document.documentelement.innerhtml, "Assn'd Shop")
lngSupCode = lngSupCode + 210
strBuildData = Mid(WebBrowser1.Document.documentelement.innerhtml, lngSupCode)
lngSupCode = InStr(strBuildData, " ")
strBuildData = Left(strBuildData, lngSupCode)
strBuildData = Mid(strBuildData, 14)
lngSupCode = InStr(strBuildData, "&") - 1
strBuildData = Left(strBuildData, lngSupCode)
strAssignedShop = strBuildData
'// Locate and assign Supv.
lngSupCode = InStr(WebBrowser1.Document.documentelement.innerhtml, "Supv.")
lngSupCode = lngSupCode + 200
strBuildData = Mid(WebBrowser1.Document.documentelement.innerhtml, lngSupCode)
lngSupCode = InStr(strBuildData, " ")
strBuildData = Left(strBuildData, lngSupCode)
strBuildData = Mid(strBuildData, 16)
lngSupCode = InStr(strBuildData, "&") - 1
strBuildData = Left(strBuildData, lngSupCode)
strSupCode = strBuildData
'// Locate and assign Shift
lngSupCode = InStr(WebBrowser1.Document.documentelement.innerhtml, "Shift")
lngSupCode = lngSupCode + 200
strBuildData = Mid(WebBrowser1.Document.documentelement.innerhtml, lngSupCode)
lngSupCode = InStr(strBuildData, " ")
strBuildData = Left(strBuildData, lngSupCode)
strBuildData = Mid(strBuildData, 14)
lngSupCode = InStr(strBuildData, "&") - 1
strBuildData = Left(strBuildData, lngSupCode)
strShift = strBuildData
Thanks,
TheChazm
how to set Page size for this control
and
how to set Page orientation L/p
i have use this control as Report Viewer in my application
some report on Landscape and some Portrait
some page A4 and Some Legal
Please Help Me
WebBrowser control does not have a landscape/portrait setting. You change the width and height of the control to the size you want.
.Width = 8.5 and .Height = 11 will give you portrait whereas .Width = 11 and .Height = 8.5 will give you landscape. Just like CDRIVE told you in post #103. What else do you want?
I am trying to learn the DOM rather than doing what I have done in the past, parsing out an entire HTML page. I don't seem to "get" the DOM for some reason.
I am attempting to use the example here but I can't seem to find the "alt=xxxx" values within the AnchorElement.
I am using this block of code above from this thread:
The code above finds all the "href" info from all the links like this in the document, but how do I programatically find what the "alt" value is that is associated with these links? There is no supported attribute for "alt" that I can find, i.e. HTMLlinks.alt <<< INVALIDCode:Option Explicit
Private Sub Form_Load()
WebBrowser1.Navigate "www.vbforums.com"
End Sub
Private Sub WebBrowser1_DownloadComplete()
'you must add the "Microsoft HTML Object Library"!!!!!!!!!
Dim HTMLdoc As HTMLDocument
Dim HTMLlinks As HTMLAnchorElement
Dim STRtxt As String
' List the links.
On Error Resume Next
Set HTMLdoc = WebBrowser1.Document
For Each HTMLlinks In HTMLdoc.links
STRtxt = STRtxt & HTMLlinks.href & vbCrLf
Next HTMLlinks
Text1.Text = STRtxt
End Sub
Here is the HTML snipit that HTMLlinks.href finds. I need to know the alt=xxx value associated with it:
Code:<a href="main.php?g2_itemId=28"><img src="main.php?g2_view=core.DownloadItem&g2_itemId=68&g2_serialNumber=2" width="200" height="86" id="IFid1" class="ImageFrame_none giThumbnail" alt="Pyramids"/></a>
Thanks!
I have a very large photo gallery on a system where the DB got corrupted. Good news is I can view my old gallery but I just can't add anything to it. I have recreated a second image of it on another URL with all the photos but no descriptions of any of them. I need to copy over the descriptions. I am currently trying to use Webbrowser control to copy all the text from the corrupt gallery to the new gallery.
I have a Webbrowser1 and Webbrowser2 session set up with the 2 screens I want to copy from and to. I would like to learn to do this in the browser control rather than copy/paste if possible, but I will ultimately take advise on anything that works.
There are around 36 input fields to copy on each page but they exist as 2 types with different names. Here are the 2 types:
Copy from/to Field type 1:
Copy from/to Field type 2:Code:<input type="text" id="summary_130" size="60"
name="g2_form[items][130][summary]" value="The road to Alaska was a long and hard one.l"/>
<h4> Keywords </h4>
Of course my code will use the item numbers in the brackets [129], [130] etc to identify what goes where but how do I get started with a browser control to copy and paste from these two types of fields, an Input "value" and a textarea data-string?Code:<textarea id="description_129" rows="4" cols="60"
name="g2_form[items][129][description]">Land travel to Alaska is a long and challenging task for anyone to undertake.</textarea>
Thanks!
Did you ever find an answer to this question?? I have a similar issue.
I would like to get information from an html table that looks like this.
<tr class="vcard">
<td style="border-bottom: 1px solid gray"> </td>
<td style="border-bottom: 1px solid gray"><span class="tel">(###) ###-####</span> </td>
<td style="border-bottom: 1px solid gray"><br><strong><span class="fn org">ANY Insurance Agency</span></strong><br>
<span class="adr">
<span class="street-address">Any Address</span><br>
<span class="locality">ThisState</span><br>
<span class="region">MO</abbr>
</span>
</td>
<td style="border-bottom: 1px solid gray"> </td>
</tr>
This is more html code but im only trying to access "fn", "tel", "fn org",
"street-address","locality", and"region".
Here are so facts i know. They list the agents info under a vcard element. Under that element there are name, tel, and orgainize listed. Then the address information is listed under the element "adr". So i need to loop throught the information getting each set of agent information
It's a catch 22; if you understood this stuff well enough to code in it, then you wouldn't be coding in it ;-)
I still don't grasp the DOM myself but being a lame hacker who codes mostly by example, this helped me a lot. It sort of enumerates most of the major parts of the DOM. I have altered my own version of it in fact with about 3 more screens and a verbose log file that even borders on being unreadable since it doubles down on so many example calls to the DOM. I use it as a shell to go to the website I plan to manipulate and find what I am looking for and go from there.
I am not saying this will work for you, but for the most part I just run this, peruse through the output until I find what I am looking on one of the display output panels and then "cheat" by locating the VB code that produces the shortest path to accessing the info you are searching for.
If you are into bass-ackwards coding like me, maybe this will help get you started:
http://vb-helper.com/howto_get_webbrowser_text.html
Also don't make the same "first mistake" I made by thinking that if you log into a session manually with IE that your VB browser control session code testing will automatically be logged in too just because you have open an active conventional IE user session with the same website. They are separate and you will have to code any log-in sequence into your routine as well.
i love u all :p
hi, is it possible do determine whether a text (SPAN element) text is visible or not?
i tried:
body.parentElement.innerText
body.parentElement.outerText
even i manually select all (Ctrl+A) then paste into a text box and still that text (text is "invalid captcha warning" exits. but not visible in the control/browser..
but i need to get is it visible or not to track if user put correct cpathca or wrong..
i hope i a clear and waiting for someones help...
best regards
kamrul Hassan
this thread has been very useful, many thanks !
But I still have some problems.
My application is very simple: to prepare a series of map printout from Google Maps, for a list of points I have in a DB.
So I loop through the point, send the correct address to google maps and get the image on the webbrowser object in my form. Then issue the print command using pdf creator as printer.
The problem is that I would like to launch the procedure and get all the printout, but at now I must have put a msgbox after each point; without it the printout are empty, because the print command does not wait for the page to complete.
May someone give ne a hint ?
thx
David
Can anyone help on how to simulate typing, which is a combination of onkeydown, onkeypress and onkeyup events?
regards
Hello,
I'm trying to write a simple routine that write a text in the page http://tinywebdb.appspot.com/storeavalue and press the button "Store a value".
Looking the html source of the page, the name of the first field il "Tag", the name of the second field is "Value" and the name of the button is "fmt"
My test code is
WebBrowser.Document.All("Tag").focus
WebBrowser.Document.All("Tag").Value = "xxxxxx"
WebBrowser.Document.All("Value").focus
WebBrowser.Document.All("Value").Value = "yyyyyy"
WebBrowser.Document.All("fmt").Click
but nothing happen on the last row (don't click)
Any idea?
Thank you, Gianluca
How can i get the url of the site that is going to get navigated?Is there a property of webrowser for it?
Thanx in advance..
Is "Disabling functions appropriately" code on the first page supposed to disable CTRL+P? If so, it does not.
Is there a third way of disabling CTRL+P besides hooking keyboard or using WBCustomizer.dll?
Checkbox in a page, how to control it
in the website, the checkbox i wanna check, the code is like this
<input type="checkbox" onchange="groupCheck(this.checked)">
and from your guide, WebBrowser1.Document.GetElementById("PersistentCookie").Checked = True 'checked
that i cant find, help me out with this, i'm using visual studio 2008