Closed munishmarya closed 3 years ago
Hi @munishmarya
Instead of using keyboard and clipboard to access the webpage you can directly access it with the url as a step
https://www.drivenproperties.com/dubai-real-estate-market-guide/rental-transactions
rows = count('//*[@id="dpx-sold-grid-tbody"]/tr')
echo `rows`
doing this in live mode gives the result of 51 for me:
thanks for reply @ruthtxh . I tried again following your approach but same results for me 0 rows, i am saving the flow and using cmd to run. I have used the latest package from https://tagui.readthedocs.io/en/latest/setup.html
@ruthtxh edited 18.03 IST I tested in live mode, starge enough it worked with 51 results but why on flow execution from command prompt it returns 0??
flow results
flow used:
https://www.drivenproperties.com/dubai-real-estate-market-guide/rental-transactions
rows = count('//*[@id="dpx-sold-grid-tbody"]/tr')
echo `rows`
Hi @munishmarya, seems like the webpage takes a while to load. You may add a wait step in between like this for a 3 second delay:
https://www.drivenproperties.com/dubai-real-estate-market-guide/rental-transactions
wait 3
rows = count('//*[@id="dpx-sold-grid-tbody"]/tr')
echo `rows`
see diff after adding the wait step:
@ruthtxh thanks, you are a star. It worked after wait time, have patience let it load :)
@munishmarya no problem, feel free to ask anything!
Adding on, if you prefer a dynamic wait time instead of a fixed time, you can use hover step on some element that only shows up when the page is fully loaded. That way, once the page is done loading, automation proceeds.
Hi,
I have used tagui in past and its great, but this is my first time dealing with xpath. I am using below flow but tagui is reading count of rows as zero while in the webpage there are 51 instances of the xpath (I checked xpath using chrome console result was 51)
results from tagui:
START - automation started - Tue Aug 03 2021 10:08:37 GMT+0530 (India Standard Time) keyboard [win]r keyboard chrome[enter] wait 2 keyboard [ctrl][v][enter] wait 2 dump date, community, propertyname, type, bedroom, price, sqft, pricesqft to drivenproperties.csv 'row counted' 0
flow used:
keyboard [win]r keyboard chrome[enter] clipboard('https://www.drivenproperties.com/dubai-real-estate-market-guide/rental-transactions') wait 2 keyboard [ctrl][v][enter] wait 2 dump date drivenproperties.csv rows = count('//[@id="dpx-sold-grid-tbody"]/tr') echo 'row counted'
rows
for row from 1 to rows echo 'for started 'row
read //[@id="dpx-sold-grid-tbody"]/tr[row
]/td[2] to date