bobheart Posted May 22, 2004 Share Posted May 22, 2004 can you use au3 to grab text off of a webpage ? and how ? Link to comment Share on other sites More sharing options...
bobheart Posted May 23, 2004 Author Share Posted May 23, 2004 can this be changed to do text?;Working on my W2000 computer with Active desktop disabled.$title = "Display Properties"$wallpaper = "winnt";<------- Put here the filename you want after you copied the .bmp file it in @windir. (or set it "(none)")Run(@comspec & " /c " & @Windowsdir & "\system32\desk.cpl","",@sw_hide)WinWait($title)ControlFocus($title, "", "ListBox2")ControlSend($title, "", "ListBox2",$wallpaper)ControlClick($title, "", "Button7"); Ok button Link to comment Share on other sites More sharing options...
Josbe Posted May 23, 2004 Share Posted May 23, 2004 can this be changed to do text?Displaying literally this? Extract every line with another script. (FileRead() function...maybe) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta Link to comment Share on other sites More sharing options...
bobheart Posted May 23, 2004 Author Share Posted May 23, 2004 (edited) I tried www.google.com and got $file = FileOpen("http://www.google.com/", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in 1 character at a time until the EOF is reached While 1 $chars = FileRead($file, 1) If @error = -1 Then ExitLoop MsgBox(0, "Char read:", $chars) Wend FileClose($file) --------------------------- Error --------------------------- Unable to open file. --------------------------- OK --------------------------- So what do id do ? Edited May 23, 2004 by bobheart Link to comment Share on other sites More sharing options...
scriptkitty Posted May 23, 2004 Share Posted May 23, 2004 look up URLDownloadToFile () it saves the web page as a text document, from there you can read it. AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
bobheart Posted May 23, 2004 Author Share Posted May 23, 2004 (edited) Well it saved it as html page and looks just like the page too , wow this cool . I was trying learn how to input the url with out hard coding it in the au3 but didn't see anything or how to do it ? is there a way to have a inpy msg box to add a url to download ? How would you use a input box like this to what url you want to grab ? $answer = InputBox("Question", "What URL ", "add url here", "", -1, -1, 0, 0) Edited May 23, 2004 by bobheart Link to comment Share on other sites More sharing options...
trids Posted May 23, 2004 Share Posted May 23, 2004 If you just want the text (like a screenscraper), you can also just copy it to clipboard if u have the page in the browser already:Send "Select All" to the browser. In MSIE, you send Ctrl-AThen copy to clipboard: send Ctrl-CNow you can process the clipboard with ClipGetHope this helps Link to comment Share on other sites More sharing options...
bobheart Posted May 23, 2004 Author Share Posted May 23, 2004 No what I have now works great and grabs the page like I ant , I want to be able to input the link into a msg box and not hard code it in . Link to comment Share on other sites More sharing options...
scriptkitty Posted May 23, 2004 Share Posted May 23, 2004 $answer = InputBox("Question", "What URL ", "add url here", "", -1, -1, 0, 0) URLDownloadToFile ($answer,"c:\temphtml.html") AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
scriptkitty Posted May 23, 2004 Share Posted May 23, 2004 Aye Larry, I was just trying to keep it simple. On a side note, not all urls will download with this function, as it looks for an exact page. You might just want to open up an explorer window, and do the control+A Control+c and paste it into a file or msgbox. Or just wait til loaded and use the savepageas send("!fa") AutoIt3, the MACGYVER Pocket Knife for computers. Link to comment Share on other sites More sharing options...
bobheart Posted May 23, 2004 Author Share Posted May 23, 2004 Thank you this works fine for what I want to do .. thank you for your help guys and gals .. Link to comment Share on other sites More sharing options...
SlimShady Posted May 23, 2004 Share Posted May 23, 2004 Thank you this works fine for what I want to do .. thank you for your help guys and gals .. I'm glad to hear that you're happyYou can ask anything you want and we'll try to help you. 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