Sign in to follow this  
Followers 0
ice1000

Help with dropdown in webpage

5 posts in this topic

I want to retrieve each option value from a select tag on a web page and list them in one column in Excel. My code correctly retrieves the option value but it puts each value in the same cell instead of moving down one cell for each value.

Anyone have any ideas on what I am doing wrong?

$oExcelx = ObjGet("","Excel.Application");Get current instance of Excel
$oIE = _IEAttach("Sheet Editor")

$oExcelx.Activeworkbook.Activesheet.range("D1").Activate

;trying to get correct found account
$oFoundAccount = _IEGetObjById ($oIE, "SelectAccounts")
$o_Options = _IETagNameGetCollection($oFoundAccount, "option")

For $o_Option in $o_Options
    $iCurrentRow = 1
    $oExcelx.Activeworkbook.Activesheet.cells($iCurrentRow,4).value = $o_Option.text
    $iCurrentRow = $iCurrentRow + 1
Next

Share this post


Link to post
Share on other sites



$oExcelx = ObjGet("","Excel.Application");Get current instance of Excel
$oIE = _IEAttach("Sheet Editor")

$oExcelx.Activeworkbook.Activesheet.range("D1").Activate

;trying to get correct found account
$oFoundAccount = _IEGetObjById ($oIE, "SelectAccounts")
$o_Options = _IETagNameGetCollection($oFoundAccount, "option")

For $o_Option in $o_Options
    $iCurrentRow = 1;<----------------move this to before the for/next loop#############################
    $oExcelx.Activeworkbook.Activesheet.cells($iCurrentRow,4).value = $o_Option.text
    $iCurrentRow = $iCurrentRow + 1
Next


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

THAT was a simple programming error.

I can't test because the code refuses to work.

When executing, I get the following error: Variable must be of type "Object".:

Excel is open and the ObjGet is apparently not getting the correct object.

Why is the code all of the sudden bombing?

Share this post


Link to post
Share on other sites

THAT was a simple programming error.

I can't test because the code refuses to work.

When executing, I get the following error: Variable must be of type "Object".:

Excel is open and the ObjGet is apparently not getting the correct object.

Why is the code all of the sudden bombing?

Rebooting solved the problem. This has happened a few times.

Is there a way to 'reset' AutoIt so I don't have to reboot?

Share this post


Link to post
Share on other sites

It is not AutoIt that needs to be "reset". More likely it is a foobar excel.exe running on your system. Exit Excel and then use task manager to kill excel.exe if it is still running.

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