|
-
Sep 4th, 2006, 03:44 AM
#1
Thread Starter
Hyperactive Member
Getting HTML source code
VB Code:
Form1.txtHTML = Form1.WebBrowser1.document.body.innerHTML
currently i have a web browser in which i need to get the souce code for the page i am viewing, previously i was using the above code with the ie control, but i have swapped this control for the firefox activex control due to other issues. This now causes an error of
"Automation Error
Library not registered"
i have to get the code from this browser window as using a different control takes me to the home page of the site (need to be logged in to view this page)
Do you wake up in the morning feeling sleepy and grumpy? Then you must be Snow White
-
Sep 4th, 2006, 04:37 AM
#2
Thread Starter
Hyperactive Member
Re: Getting HTML source code
...so noone knows how to get the source code for a webpage using the firefox control
Do you wake up in the morning feeling sleepy and grumpy? Then you must be Snow White
-
Sep 4th, 2006, 04:40 AM
#3
Re: Getting HTML source code
Looks like you need to register the firefox control first
-
Sep 4th, 2006, 04:56 AM
#4
Re: Getting HTML source code
Why don't you use Inet (MS Internet Transfer Control) to get the source? 
VB Code:
Dim source As String
source = Inet1.OpenURL("http://www.blablabla.com")
-
Sep 4th, 2006, 05:23 AM
#5
Re: Getting HTML source code
Cool site gavio
-
Sep 4th, 2006, 02:52 PM
#6
Thread Starter
Hyperactive Member
Re: Getting HTML source code
@gavio: last line of the post... i cannot use another control to access the page as the way i access this page is to go to one page, sign in, and then go to another page, and just loading the page direct with inet gives me the code for the sign-in page. theres probably a long-winded way of doing it using inet but it has to repeat this a lot so i want to take as short a time as possible
Do you wake up in the morning feeling sleepy and grumpy? Then you must be Snow White
-
Sep 4th, 2006, 03:12 PM
#7
Thread Starter
Hyperactive Member
Re: Getting HTML source code
and the component is registered, as everything else works, it loads pages and acts as a browser fine. this is the line that causes the error:
VB Code:
strSourceCode = WebBrowser1.document.body.innerHTML
Do you wake up in the morning feeling sleepy and grumpy? Then you must be Snow White
-
Sep 4th, 2006, 09:57 PM
#8
Re: Getting HTML source code
You said in post one you were using the Firefox control because of other reasons....what are the other reasons as I have used the Webbrowser control to get the source of a page without any problems?
-
Sep 5th, 2006, 07:01 PM
#9
Thread Starter
Hyperactive Member
Re: Getting HTML source code
yea getting source from the ie webbrowser control was no problem at all, however for some reason ie webbrowser kept getting errors on every page that i either had to click yes "continue running scripts" or set silent=true and then it didnt render the web page correctly
Do you wake up in the morning feeling sleepy and grumpy? Then you must be Snow White
-
Sep 5th, 2006, 07:15 PM
#10
Re: Getting HTML source code
 Originally Posted by Arachnid13
however for some reason ie webbrowser kept getting errors on every page
Are you sure the java scripts errors were on every page? Do you have an example of a site that gives the error?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|