I tried searching, but could not find anything...possibly searching for wrong terms. Please move if this does not belong in this forum.
I am using Dim myText As String = Me.WebBrowser1.Document.Body.InnerText to load the current page of webbrowser1 to a string to manipulate.
The page has paragraph text as well as text within a table. This is a quick example of what I'm testing with:
Blah blah blah more blah an even more blah, the blah blah blah blah, the blah blah blah blah
[TABLE="width: 500, align: center"]
[TR]
[TD]first name[/TD]
[TD]last name[/TD]
[TD]date of birth[/TD]
[/TR]
[TR]
[TD]Nobody[/TD]
[TD]Inparticular[/TD]
[TD]01/01/1900[/TD]
[/TR]
[TR]
[TD]Another[/TD]
[TD]Namehere[/TD]
[TD]10/10/2000[/TD]
[/TR]
[/TABLE]
When it loads to string and I put it in a rich text box with richtextbox1.text = myText it appears like this:
Blahblahblahmoreblahanevenmoreblah,theblahblahblahblah,theblahblahblahblah
firstnamelastnamedateofbirth
NobodyInparticular01/01/1900
AnotherNamehere10/10/2000,
(not sure why the space shows up...i've edited after preview, even changed the text, still a space. maybe because using chrome?)
But when I use InStr extract data, it actually counts the spaces as if they were there. So the first "/" shows up at 131 (took me a minute to realize the vbCrLf is also counted as a character).
So I am able to extract the data I need, but I would like to know why this is in case I run into issues with this in the future.
TIA
Edit: Just looked one more time using msgbox and see that paragraph text actually has spaces, but the table text does not. So am I correct in assuming that the table is using a character placeholder like the vbCrLf?
I am using Dim myText As String = Me.WebBrowser1.Document.Body.InnerText to load the current page of webbrowser1 to a string to manipulate.
The page has paragraph text as well as text within a table. This is a quick example of what I'm testing with:
Blah blah blah more blah an even more blah, the blah blah blah blah, the blah blah blah blah
[TABLE="width: 500, align: center"]
[TR]
[TD]first name[/TD]
[TD]last name[/TD]
[TD]date of birth[/TD]
[/TR]
[TR]
[TD]Nobody[/TD]
[TD]Inparticular[/TD]
[TD]01/01/1900[/TD]
[/TR]
[TR]
[TD]Another[/TD]
[TD]Namehere[/TD]
[TD]10/10/2000[/TD]
[/TR]
[/TABLE]
When it loads to string and I put it in a rich text box with richtextbox1.text = myText it appears like this:
Blahblahblahmoreblahanevenmoreblah,theblahblahblahblah,theblahblahblahblah
firstnamelastnamedateofbirth
NobodyInparticular01/01/1900
AnotherNamehere10/10/2000,
(not sure why the space shows up...i've edited after preview, even changed the text, still a space. maybe because using chrome?)
But when I use InStr extract data, it actually counts the spaces as if they were there. So the first "/" shows up at 131 (took me a minute to realize the vbCrLf is also counted as a character).
So I am able to extract the data I need, but I would like to know why this is in case I run into issues with this in the future.
TIA
Edit: Just looked one more time using msgbox and see that paragraph text actually has spaces, but the table text does not. So am I correct in assuming that the table is using a character placeholder like the vbCrLf?
Last edited: