Edge equivalent for IEExtractTable
Moderators: Dorian (MJT support), JRL
Edge equivalent for IEExtractTable
Hi,
With Microsoft planning on decommissioning IE11 from windows for good, I'm busy trying to convert some existing scripts to use Edge browser instead.
I need to Extract a table from the web page to a csv file, which is being done successfully currently via the IEExtractTable command.
Is there a similar functionality I can achieve via the Edge commands ?
Thanks,
With Microsoft planning on decommissioning IE11 from windows for good, I'm busy trying to convert some existing scripts to use Edge browser instead.
I need to Extract a table from the web page to a csv file, which is being done successfully currently via the IEExtractTable command.
Is there a similar functionality I can achieve via the Edge commands ?
Thanks,
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Edge equivalent for IEExtractTable
Hi,
No there isn't.
You'll need to extract the table tag (or if more convenient tr or td tag) and parse out the data yourself.
No there isn't.
You'll need to extract the table tag (or if more convenient tr or td tag) and parse out the data yourself.
Yes, we have a Custom Scripting Service. Message me or go here
Re: Edge equivalent for IEExtractTable
Thanks for confirming Dorian!
Also for IE, macro scheduler had IEFormFill, which I was using to fill in read only input fields like date fields mapped to javascript mini calendars (to avoid manipulating the pop-up window for desired date) as well as dropdown inputs by setting the index of the select input.
I couldn't achieve similar functionality utilizing EdgeFindElements/EdgeSetElementValue
How can I set the read only inputs and select input to the desired value that I'm currently doing with IEFormFill?
Thanks again,
Also for IE, macro scheduler had IEFormFill, which I was using to fill in read only input fields like date fields mapped to javascript mini calendars (to avoid manipulating the pop-up window for desired date) as well as dropdown inputs by setting the index of the select input.
I couldn't achieve similar functionality utilizing EdgeFindElements/EdgeSetElementValue
How can I set the read only inputs and select input to the desired value that I'm currently doing with IEFormFill?
Thanks again,
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Edge equivalent for IEExtractTable
Datepickers tend to vary, so often one solution won't fit another. However, taking the following one as an example, we can use xpath to enter the date without needing the pop-up. Hopefully this may get you started.
//Datepicker HTML
//Macro Scheduler code :
For select/option, index is no longer an option, but there is a workaround of sorts.
Below are two ways of selection options :
This would select the third option :
Other than that we can use these two methods :
Option 1:
Option 2:
//Datepicker HTML
Code: Select all
<!DOCTYPE html>
<html>
<head>
<style>
body {
text-align: center;
}
</style>
</head>
<body>
<h2 style="color:green">GeeksforGeeks</h1>
<b> How to add a datepicker in form using HTML
</b>
<br>
<h4>Date Of Birth:
<input type="datetime-local" id="Test_DatetimeLocal">
</h4>
</body>
</html>
Code: Select all
//<input type="datetime-local" id="Test_DatetimeLocal">
//DD/MM/YYYY
EdgeFindElements>session_id,xpath,//input[@id='Test_DatetimeLocal'],el
EdgeSetElementValue>session_id,el_1,20/12/2023
Below are two ways of selection options :
Code: Select all
<select id="sel">
<option value="123" selected="selected">text1</option>
<option value="44">text2</option>
<option value="882">text3</option>
</select>
This would select the third option :
Code: Select all
Let>strXPATH=//select[@id='sel']//descendant::option
EdgeFindElements>session_id,xpath,strXPATH,strElementID
EdgeElementAction>session_id,strElementID_3,click
Option 1:
Code: Select all
EdgeFindElements>session_id,xpath,//select[@id='sel'],el
EdgeSetElementValue>session_id,el_1,text3
Code: Select all
EdgeFindElements>session_id,xpath,//option[@value='882'],el
EdgeElementAction>session_id,el_1,click
Yes, we have a Custom Scripting Service. Message me or go here
Re: Edge equivalent for IEExtractTable
Thanks Dorian, setting the select input via the Option #1 you provided worked perfectly !
However, in the case of the input type "text" readonly fields, I'm unable to set their values to valid date with EdgeSetEelementValue like I did before utilizing IEFormFill.
If this helps, this is how the embedded javascript code function currently sets the readonly value to the popup calendar selected value :
What else can I do to get these fields populated ?
Thanks once again
However, in the case of the input type "text" readonly fields, I'm unable to set their values to valid date with EdgeSetEelementValue like I did before utilizing IEFormFill.
Code: Select all
<input type="text" name="startDate" readonly>
Code: Select all
document.forms["searchRequestForm"]["startDate"].value = dateStr
Thanks once again
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Edge equivalent for IEExtractTable
I've been testing quite exhaustively this afternoon and I'm wondering if it's simply that the Edge/Chrome commands "obey" readonly but the IE commands don't.
In all honesty that's getting beyond my level of experience, so I will ask Marcus to weigh in / confirm.
In all honesty that's getting beyond my level of experience, so I will ask Marcus to weigh in / confirm.
Yes, we have a Custom Scripting Service. Message me or go here
Re: Edge equivalent for IEExtractTable
Thanks again Dorian, appreciate the due diligence!
From the Edge Browser itself, it allows me to manually execute the following from the Dev Tools Console window and it sets the input text readonly fields successfully:
I noticed Chrome has the added command of ChromeExecute which Edge does not have. Unfortunately I cannot use Chrome as my browser for the script due to the updates frequency of Chrome and having to download the latest chromedriver.exe every time to match the Chrome Browser GUI. For Edge on the other hand, my company manages the updates, so the updates aren't as frequent.
Is there some way then now to call custom javascript code injected via the Edge Browser session ?
Many Thanks,
From the Edge Browser itself, it allows me to manually execute the following from the Dev Tools Console window and it sets the input text readonly fields successfully:
Code: Select all
document.forms["searchRequestForm"]["startDate"].value="3/19/2023";
Is there some way then now to call custom javascript code injected via the Edge Browser session ?
Many Thanks,
- Dorian (MJT support)
- Automation Wizard
- Posts: 1380
- Joined: Sun Nov 03, 2002 3:19 am
- Contact:
Re: Edge equivalent for IEExtractTable
I tested the following :
And it did indeed enter the date. There is not currently an EdgeExecute command. Let's see what Marcus has to say about that as a possibility. I would think that if it was a possibility, he would have added it when adding ChromeExecute.
Code: Select all
ChromeExecute>session_id,document.forms["searchRequestForm"]["startDate"].value="3/19/2023";
Yes, we have a Custom Scripting Service. Message me or go here