Keniger Posted April 25, 2013 Share Posted April 25, 2013 (edited) I have example : " <th scope='col' class='col_f_post'>Ostatni post</th> </tr> <!-- BEGIN TOPICS --> <tr itemscope itemtype="[url="http://schema.org/Article"]http://schema.org/Article"[/url] class='__topic expandable' id='trow_718292' data-tid="718292"> <td class='col_f_icon altrow short'> " I want delete all data before <!-- BEGIN TOPICS --> To get only this : <!-- BEGIN TOPICS --> <tr itemscope itemtype="[url="http://schema.org/Article"]http://schema.org/Article"[/url] class='__topic expandable' id='trow_718292' data-tid="718292"> <td class='col_f_icon altrow short'> Is that possible to do ? Edited April 25, 2013 by Keniger Link to comment Share on other sites More sharing options...
mikell Posted April 25, 2013 Share Posted April 25, 2013 Of course, put the text you posted in a txt file named "1.txt" and run this Msgbox(0,"", StringRegExpReplace(FileRead("1.txt"), '(?s).+<!-- BEGIN TOPICS -->.+)', "$1") ) Link to comment Share on other sites More sharing options...
MouseSpotter Posted April 25, 2013 Share Posted April 25, 2013 And if you want to do it to the webpage itself - you can use IE.Au3 library to read the table HTML - perform the same replace statement as per mikell's post and put the result back. Link to comment Share on other sites More sharing options...
mikell Posted April 25, 2013 Share Posted April 25, 2013 Hum for this InetRead is better (and faster) than the _IEBodyReadHtml() Link to comment Share on other sites More sharing options...
kylomas Posted April 25, 2013 Share Posted April 25, 2013 mikell, Perhaps you meant this Msgbox(0,"", StringRegExpReplace(FileRead("1.txt"), '(?s).+(<!-- BEGIN TOPICS -->.+)', "$1") ) * - opening paren for capturing group mising kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now