Sign in to follow this  
Followers 0
tradertt

IE script - Seach a certain string in a webpage and save that string into an text file

11 posts in this topic

Hi

Does anyone know how to code a AU3 script that can:

1) Search for a string in the active internet explorer window

2) String can be like

http://www.abc.com

http://www.yahoo.com

http://www.fhd.com

so search for the string http:// (if there are more than 1 text string of http:// then it will paste all the http:// strings.

3) Copy the whole string

4) Paste it in a text file and move on to the next line

5) End the program

Please assist.

Thank you

Share this post


Link to post
Share on other sites



Hi

Does anyone know how to code a AU3 script that can:

1) Search for a string in the active internet explorer window

2) String can be like

http://www.abc.com

http://www.yahoo.com

http://www.fhd.com

so search for the string http:// (if there are more than 1 text string of http:// then it will paste all the http:// strings.

3) Copy the whole string

4) Paste it in a text file and move on to the next line

5) End the program

Please assist.

Thank you

If all you are trying to do is write the links from a page into a file, you dont need any of the copy/paste nonsense. I would use either IE.au3 and get the LinkCollection or INetGetSource and parse out links with StringRegExp. Then write your findings to a file.


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

_IELinkGetCollection -- part of IE.au3

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Hi sorry for the late reply. The above does not work as the link that I want to capture is only a TEXT not a Hyperlink

http://www.arcadecity.net/index.php?page=l...de&submit=1

Thank you for submitting your link. It has been submitted for moderator approval and should show up shortly.

You can start linking to us using this link: http://www.arcadecity.net/link.php?action=in&id=126

Take a look at it - It is only a text link - how can I extract only that specific link out

Share this post


Link to post
Share on other sites

Hi sorry for the late reply. The above does not work as the link that I want to capture is only a TEXT not a Hyperlink

http://www.arcadecity.net/index.php?page=l...de&submit=1

Thank you for submitting your link. It has been submitted for moderator approval and should show up shortly.

You can start linking to us using this link: http://www.arcadecity.net/link.php?action=in&id=126

Take a look at it - It is only a text link - how can I extract only that specific link out

I don't see anything like this on the page you supplied.

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Opt("MustDeclareVars",1) 
#include <IE.au3>

Dim $variable, $oIE, $o_IE, $o_object
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
WinActivate("Microsoft Excel")
WinWait("Microsoft Excel")
Send("{DOWN}{CTRLDOWN}c{CTRLUP}")
$o_IE = _IECreate ()
$variable=ClipGet()
_IENavigate($o_IE, $variable)
#region --- ScriptWriter generated code Start --- 
Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Sleep(5000)
WinActivate("Internet Explorer")
WinActivate("AutoFill - RoboForm")
WinWait("AutoFill - RoboForm")  
Sleep(1000)
Send("{ALTDOWN}s{ALTUP}")
#endregion --- ScriptWriter generated code End ---
_IELoadWait ($o_object)
Sleep(10000)
#region --- ScriptWriter generated code Start --- 
WinActivate("Microsoft Internet Explorer")
WinWaitActive("Microsoft Internet Explorer")
Send("{SHIFTDOWN}{F10}{SHIFTUP}")
Sleep(500)
Send("v")
WinActivate("Notepad","")
WinWaitActive("Notepad","")
Send("{CTRLDOWN}f{CTRLUP}")
WinActivate("Find","Fi&nd what:")
WinWaitActive("Find","Fi&nd what:")
Send("you can start linking to us{ENTER}")
Sleep(500)
Send("{ESC}")
WinActivate("Notepad","")
WinWaitActive("Notepad","")
Send("{DOWN}{HOME}{SHIFTDOWN}{END}{SHIFTUP}{CTRLDOWN}c{CTRLUP}{ALTDOWN}{F4}{ALTUP}")
#endregion --- ScriptWriter generated code End ---

This is my latest code - however at the portion:

_IELoadWait ($o_object)

I want it to wait till I have submitted the form and it has loaded the next page successfully before viewing the source of the webpage.

how can I do that?

Share this post


Link to post
Share on other sites

I don't understand your last question.

To get the link you are looking for however, you can use this technique:

#include <IE.au3>
$tryAttach = True
$oIE = _IECreate("http://www.games2web.com/index.php?page=link_trade&submit=1", $tryAttach)
$sAllHTML = _IEBodyReadHTML($oIE) ; you can get all HTML and parse it
$sAllText = _IEBodyReadText($oIE) ; you can get all Text and parse
$oTable = _IETableGetCollection($oIE, 22) ; 23rd table on the page has your text
$sTableText = $oTable.innerText ; get just the text in that table and parse it

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0