Sign in to follow this  
Followers 0
v3n0m007308

IE automation - colspan problem

5 posts in this topic

Hi folks, first of all: Thanks to Dale for this great udf.

I only got one problem, which I appearantly can't solve myself :P

I use the udf, to read the timetable of my school.

there are some colspans in the table, so when a lesson takes 3 hours, it is just colspan=3.

the point is, when reading this table, it only takes the first part of the cell, the second & third, are kept empty.

I already found that this is correct, but it isn't really what I need :D

so basicly my question is:

is it possible to clone the content of the leftmost element of the cell, to the colspan parts?

sorry if my question isn't clear enough, can't explain it very well I think :D

so when I have 5 td's, and the 3rd one has a colspan of 3, I would like to get this:

1st - hi

2nd - this

3rd - is

4th - a

5th - test

$array[0] hi

$array[1] this

$array[2] is

$array[3] is

$array[4] is

$array[5] a

$array[6] test

hope this is clear :)

thanks in advance.

Share this post


Link to post
Share on other sites



Probably the easiest thing to do would be to clone the logic of _IETableWriteToArray() and modify it to suit your needs in your own function.

You'll find conditional statements dealing with COLSPAN cells and it would be pretty simple to change it to copy the first value forward instead of leaving the spanned cells empty.

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

Probably the easiest thing to do would be to clone the logic of _IETableWriteToArray() and modify it to suit your needs in your own function.

You'll find conditional statements dealing with COLSPAN cells and it would be pretty simple to change it to copy the first value forward instead of leaving the spanned cells empty.

Dale

thanks for the quick answer :)

I already took a quick look at your function, and I found the word colspan a few times, but I couldn't really find how I could change it.

my autoit knowledge is pretty basic, but I'll give it a shot.

thanks again.

Share this post


Link to post
Share on other sites

thanks for the quick answer :)

I already took a quick look at your function, and I found the word colspan a few times, but I couldn't really find how I could change it.

my autoit knowledge is pretty basic, but I'll give it a shot.

thanks again.

I haven't tested, but you should be able to change this:

For $td In $tds
            $a_TableCells[$col][$row] = $td.innerText
            $col = $col + $td.colSpan
        NextoÝ÷ Ù:-+ºÚ"µÍBQÜ    ÌÍÝ[ ÌÍÝÂBBQÜ   ÌÍÚHHHÈ ÌÍÝÛÛÜ[BBBIÌÍØWÕXPÙ[ÖÉÌÍØÛÛVÉÌÍÜÝ×HH    ÌÍÝ[^BBBIÌÍØÛÛH ÌÍØÛÛ
ÈBBBS^BS^

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

#5 ·  Posted (edited)

I haven't tested, but you should be able to change this:

For $td In $tds
            $a_TableCells[$col][$row] = $td.innerText
            $col = $col + $td.colSpan
        NextoÝ÷ Ù:-+ºÚ"µÍBQÜ    ÌÍÝ[ ÌÍÝÂBBQÜ   ÌÍÚHHHÈ ÌÍÝÛÛÜ[BBBIÌÍØWÕXPÙ[ÖÉÌÍØÛÛVÉÌÍÜÝ×HH    ÌÍÝ[^BBBIÌÍØÛÛH ÌÍØÛÛ
ÈBBBS^BS^

Dale

hmm, doesn't work yet, but my code may be messed up too (the reader itself), so I'm going to try some thing.

thnx for the effort :)

!!!!!EDIT!!!!

dale, your fix works great :D thanks man

the problem was in my code, I found the bug, now I just have to finish the app, but I think i can do it from now on :P

thanks for your time :D

Edited by v3n0m007308

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