|
-
Aug 30th, 2012, 12:55 PM
#1
Thread Starter
New Member
Ie Control
in vb5 how do I copy line 1006 from a web page into a text box using the internet explorer control
Last edited by Yahweh; Aug 30th, 2012 at 03:33 PM.
-
Aug 31st, 2012, 12:08 AM
#2
Re: Ie Control
line 1006 ? from source code? how are you getting source code? document.body.outerhtml?
or do you mean line 1006 of the Internet Explorer Menu (View - Source) Line 1006?
i dont know how to get 1006 line of IE Source because IE have its own Html "Source" Viewer but if you know what you are looking for its easier to get. if not you would have to get the text from IE Source Viewer's textbox will require API Calls
if you get code with inet its close but not exactly the same ...
-
Aug 31st, 2012, 08:40 AM
#3
Thread Starter
New Member
Re: Ie Control
1006 is just a random number
if i cant get it directly from the control how do i get the 1006th line of text7.text into text 1
InternetExploiter.Navigate "http://www.youtube.com/"
Dim sText As String, sTextHTML As String
Dim SleepS
sT = InternetExploiter.Document.body.innerText
sTextHTML = InternetExploiter.Document.documentElement.outerHTML
Text7.Text = sTextHTML
this is to extract certain lines of text from web pages i can convert pages for old browsers like cello
i want to take the info from sites and have a semi automatic conversion
i would have to update this each re desighn
-
Aug 31st, 2012, 08:54 AM
#4
Frenzied Member
Re: Ie Control
please always post code inside code tags. it is much better more readable
Code:
InternetExploiter.Navigate "http://www.youtube.com/"
Dim sText As String, sTextHTML As String
Dim SleepS
sT = InternetExploiter.Document.body.innerText
sTextHTML = InternetExploiter.Document.documentElement.outerHTML
Text7.Text = sTextHTML
-
Aug 31st, 2012, 01:01 PM
#5
Thread Starter
New Member
Re: Ie Control
 Originally Posted by firoz.raj
please always post code inside code tags. it is much better more readable
Code:
InternetExploiter.Navigate "http://www.youtube.com/"
Dim sText As String, sTextHTML As String
Dim SleepS
sT = InternetExploiter.Document.body.innerText
sTextHTML = InternetExploiter.Document.documentElement.outerHTML
Text7.Text = sTextHTML
Thank you
Code:
but it still doesn't answer my question
if anyone has a solution to my problem please help
it will be greatly appreciated
-
Aug 31st, 2012, 01:09 PM
#6
Thread Starter
New Member
Re: Ie Control
 Originally Posted by firoz.raj
please always post code inside code tags. it is much better more readable
Code:
InternetExploiter.Navigate "http://www.youtube.com/"
Dim sText As String, sTextHTML As String
Dim SleepS
sT = InternetExploiter.Document.body.innerText
sTextHTML = InternetExploiter.Document.documentElement.outerHTML
Text7.Text = sTextHTML
Thank you
Code:
but it still doesn't answer my question
if anyone has a solution to my problem please help
it will be greatly appreciated
-
Aug 31st, 2012, 08:24 PM
#7
Re: Ie Control
what is so interesting about line 1006? what are you trying to get out of it?
you can use a function like this (when it is split with vbnewline)
Code:
Private Function ExtractLine(LineNumber As Integer, TextString) As String
On Error GoTo ErrHandler
Dim SPT() As String 'Split Text
'When you split your array will start with 0. but in our language 0 is not a line 1 would be the first line not 0.
'so i will substract 1 number from Line_Number to be the exact match
SPT = Split(TextString, vbNewLine)
MsgBox UBound(SPT)
ExtractLine = SPT(LineNumber - 1)
Exit Function
ErrHandler:
MsgBox "Invalid Line Number.", vbInformation, "Error while Extracting Text"
End Function
Get line text like this
Code:
MsgBox ExtractLine(1,Text1.Text)
but in this case the string is all one line for some reason.. well when i use your code there is no vbNewLine split
i'm not sure exactly what you want to do but you might have to get object by object from the document... or go by TAG / ID / ELEMENT name
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
|