| |

VerySource

 Forgot password?
 Register
Search
View: 3823|Reply: 20

Extract text content in HTML under VC! Wait online! anxious! A lot of pointers!

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-12 23:30:01
| Show all posts |Read mode
How to extract text content in HTML using webbrowers control?

Example:
html file: <TD class = text_b_12_1 style = "PADDING-LEFT: 30px" colSpan = 2
      height = 30> <STRONG> Volume 1 The Six Houses Episode 1 </ STRONG> </ TD> </ TR>
  <TR>
    <TD class = text_o_12_2 align = middle colSpan = 2 height = 50> <STRONG>
      Legend of the Seven Realms </ STRONG> </ TD> </ TR>
  <TR>
    <TD class = text_b_14_1 colSpan = 2>
      <P> China has beautiful mountains and rivers. For thousands of years, countless magic legends have been circulating on this land. Since ancient times, people have always talked about those legends about immortality and immortality. Since ancient times, mortals have all died. But everyone in the world loves life and death, and Yan Luozhi of the prefecture said that it added a little bit of fear. Below this, there is a saying that immortality is immortal, which makes people dream of life. <SPAN
      class = transparent> (From The Sword Book Alliance) </ SPAN> </ P>
 


Extract it into
Seven Realms
China has beautiful mountains and rivers. For thousands of years, countless magic legends have been circulating on this land. Since ancient times, people have always talked about those legends about immortality and immortality. Since ancient times, mortals have all died. But everyone in the world loves life and death, and Yan Luozhi of the prefecture said that it added a little bit of fear. Below this, there is a saying that immortality is immortal, which makes people dream of life.


Thank you! very urgent.
Reply

Use magic Report

0

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-6-10 19:00:01
| Show all posts
No need to use webbrowers, just use wininet, then use regular
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-2 19:00:01
| Show all posts
IHTMLElement::innerText

Or as the upstairs said.
Reply

Use magic Report

0

Threads

25

Posts

19.00

Credits

Newbie

Rank: 1

Credits
19.00

 China

Post time: 2020-7-7 14:00:01
| Show all posts
If i use lex
Reply

Use magic Report

0

Threads

11

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-8-1 21:15:01
| Show all posts
Parse yourself
<>***<> Just stay in between
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-8 14:45:01
| Show all posts
I also agree with the analysis upstairs by myself, CString find will come out in a few clicks,
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-8-13 11:30:01
| Show all posts
Parse it yourself, I wrote a similar before, not difficult
Reply

Use magic Report

0

Threads

22

Posts

18.00

Credits

Newbie

Rank: 1

Credits
18.00

 Invalid IP Address

Post time: 2020-8-21 05:45:01
| Show all posts
Using DOM to fetch text directly should be a relatively lightweight solution
Reply

Use magic Report

0

Threads

6

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-8-22 16:45:01
| Show all posts
const string ExtractHTML( const string&strHTML)
{
string strTemp = strHTML;
while( true)
{
size_t szPos = strTemp.find( "<" );
if( string::npos == szPos)
return strTemp;
size_t szEnd = strTemp.find( ">", szPos );
if( string::npos == szEnd)
return strTemp;
strTemp.erase( szPos, szEnd-szPos + 1 );
}
}
Reply

Use magic Report

0

Threads

36

Posts

22.00

Credits

Newbie

Rank: 1

Credits
22.00

 Singapore

Post time: 2020-8-22 19:30:01
| Show all posts
study the walkall sample in MSDN
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/samples/internet/browser/walkall/default.asp
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list