langthang084 Posted July 18, 2014 Share Posted July 18, 2014 (edited) I want to copy a part text from website, ex: http://www.bbc.com/sport/0/football/28347957. So how to select text from the start "Van Gaal's major tittles" to the end ". When you repeat that, everybody thinks like that" then copy with the table is removed. Could anyone help me! Thanks! Edited July 18, 2014 by langthang084 Link to comment Share on other sites More sharing options...
computergroove Posted July 18, 2014 Share Posted July 18, 2014 Are there several articles that start and end with that? What do you mean by then copy with the table is removed? Do you want to print this to a text file or make it a string variable? Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
langthang084 Posted July 18, 2014 Author Share Posted July 18, 2014 yeah. I want to save from some web with the same start and end then save as document. The table is remove because i want to change form like that: Domestic leagues: ........ Champions League: ...... Uefa Cup: ...... Link to comment Share on other sites More sharing options...
computergroove Posted July 18, 2014 Share Posted July 18, 2014 Its not pretty but I was able to: 1. Goto the website 2. Select all text (CTRL + A) 3. Copy selected text (Ctrl + C) 4. Open notepad 5. Paste the data (Ctrl + V) 6. Search for Van Gaal's major titles (CTRL + F) 7. Goto the beginning of the line (Home Key) 8. Hold down shift and the ctrl + Home to select all the text above the line "Van Gaal's major titles" 9. Hit delete to remove selected data 10. Search for 'When you repeat that, everybody thinks like that' (Ctrl + F) 11. Goto the end of the line (End key) 12. Select everything under the end of the last line (Shift + CTRL + End) 13. Delete the selected data and save the text file. Hope this helps langthang084 1 Get Scite to add a popup when you use a 3rd party UDF -> http://www.autoitscript.com/autoit3/scite/docs/SciTE4AutoIt3/user-calltip-manager.html Link to comment Share on other sites More sharing options...
mikell Posted July 18, 2014 Share Posted July 18, 2014 Maybe playing with regex (raw) #Include <Array.au3> $txt = BinaryToString(InetRead("http://www.bbc.com/sport/0/football/28347957")) $res = StringRegExp($txt, '(?s)<div class="data-table-outer">(.*?)</tbody>', 3) $td = StringRegExp($res[0], '(?s)((?:<h2.*?/h2>)|(?:<td.*?/td>))', 3) $final = "" For $i = 0 to ubound($td)-1 $final &= StringStripWs(StringRegExpReplace($td[$i], '(?s)(<.*?>)|(')', ""), 3) & @crlf Next Msgbox(0,"", $final) 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