| |

VerySource

 Forgot password?
 Register
Search
Author: kingfrog

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

[Copy link]

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-23 00: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 );
}
}
---------------------------
Ask: What stuff does the following HTML code parse using this function?
<pre>
if(i <0 || i> 1000)
{
...
}
</pre>
Reply

Use magic Report

0

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-8-23 02:15:01
| Show all posts
IHTMLElement::innerText
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-24 10:15:01
| Show all posts
Occupy the post and ask, what you get is just a string. Can you get the local branch of this string? In other words, how to get the local line break mark, do you have to write your own algorithm?
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-24 10:30:01
| Show all posts
You can use the DOM tree to parse it!
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-24 10:45:01
| Show all posts
First you create a connection (createElement) and attributes, then use get_style and put_cssText,
Then use the appendChild function in IHTMLDOMNode!
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-25 18:30:01
| Show all posts
The CString method is too inelegant.

At least you have to use regular rules to be worthy of the title of programmer.

Owner, is your Html a pure file, a web page on ie, or other programs embedded with Internet_Explorer Server, or the simplest is just the html displayed by CHtmlView in your program?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-25 20:45:02
| Show all posts
IHTMLElement::innerText
How to use it? Haven't started yet, please ask
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-25 21:00:01
| Show all posts
There are rules, just write it yourself...
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-25 21:15:01
| Show all posts
Find the characteristic string A directly, get to the end of the characteristic string B, and add the format
Continue
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-8-25 21:30:01
| Show all posts
You use the DOM tree to parse, find IHTMLElement::innerText in mshtml, this should work
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