I'm working on python selenium automation, I have to fetch a text content from a Html page body which resides in a iframe content
I have tried following code to acheive , Python selenium , Want to fetch link as "https://novationleasing.com.au/?token=17fef55j0L-a6555147-59bc-11e9-bef5-00155da40d82" from the HTML pages
iframe1 = driver.find_element_by_class_name("cke_wysiwyg_frame ")
driver.switch_to.frame(iframe1)
link = driver.find_element_by_xpath("/html/body/p[2]/text()[2]").text
I want to fetch the /html/body/p[2]/text()[2] from the html. I'm getting error
invalid selector: The result of the xpath expression
"/html/body/p[2]/text()[2]" is: [object Text]. It should be an
element.
Online Application
Email View FirstNameCheck (FirstNameCheck) MiddleName Last_Name - LID 315691 -
EVOv30.3.6 (DEVELOPMENT)
var rumMOKey='b7f6f947d34b1aac3a41411c716e902c';
(function(){
if(window.performance && window.performance.timing && window.performance.navigation) {
var site24x7_rum_beacon=document.createElement('script');
site24x7_rum_beacon.async=true;
site24x7_rum_beacon.setAttribute('src','//static.site24x7rum.com/beacon/site24x7rum-min.js?appKey='+rumMOKey);
document.getElementsByTagName('head')[0].appendChild(site24x7_rum_beacon);
}
})(window)
if ($('.auto-numeric-money').length > 0)
AutoNumeric.multiple('.auto-numeric-money', AutoNumeric.getPredefinedOptions().dotDecimalCharCommaSeparator);
if ($('.auto-numeric-integer').length > 0)
AutoNumeric.multiple('.auto-numeric-integer', { decimalPlaces: 0, digitGroupSeparator: ',' });
if ($('.auto-numeric-percentage').length > 0)
AutoNumeric.multiple('.auto-numeric-percentage',
{decimalPlaces: 2, digitGroupSeparator: ',', maximumValue: "100", minimumValue: "0", suffixText: "%", unformatOnSubmit: true});
if ($('.auto-numeric-number').length > 0)
AutoNumeric.multiple('.auto-numeric-number', { decimalPlaces: 0, digitGroupSeparator: '' });
});
evo_idle_check_failed = false;
function evo_idle_check() {
if (evo_idle_check_failed) return;
$.ajax({ type: 'GET',
url: 'evo_lookup',
dataType: 'json',
data: {
lookup: 'idle',
value: app_generate_uuid(),
},
timeout: 60000, // 1 minute
success: evo_idle_check_success,
error: evo_idle_check_error,
});
}
function evo_idle_check_success(data, textStatus, jqXHR) {
if (evo_idle_check_failed) return;
if (!data['value']) evo_idle_check_error(jqXHR, textStatus, 'Logged out');
}
function evo_idle_check_error(jqXHR, textStatus, errorThrown) {
evo_idle_check_failed = true;
alert('Login session timed out');
window.location.replace('/evo/main');
}
$(document).ready(function() {
evo_idle_check_failed = false;
window.setInterval(evo_idle_check, 3600000); // 1 hour
});
TEST system. For new Development and testing relating to that. Please use DEMO system if Production comparisons are needed.
$(document).ready(function() {
CKEDITOR.replace('email_body_text', {
customConfig: '/evo-static/ckeditorconfig.js',
toolbar: 'NLCShow',
readOnly: true
});
});
Client: | sgfleet - Police Department (Vic) | Customer: | Madam FirstNameCheck (FirstNameCheck) MiddleName Last_Name | Consultant: | Automation Test <automation.test> (Non - Sales) | Lead: | Novated Finance Lease, Vehicle purchase, LID315691 ( View/Edit, | Quote: | QID657319 MAZDA CX-7 CLASSIC SPORTS (4x4) ER MY10 JTL09J N/A Unleaded ( View/Edit, | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Quote Result ID: | 1572597 ( Print/Email ) | Description: | MAZDA CX-7 CLASSIC SPORTS (4x4) ER MY10 JTL09J N/A Unleaded Novated Finance Lease, Vehicle purchase, Statutory, Employee Contribution Method (ECM), Fortnightly 2 months in arrears 2 deferred + 46 monthly finance payments inc gst $99.79 (ex gst: $90.72) purchase price inc gst $5,800.00 |
|
Online Application Email
From: | Automation Test <lob-test@nlc.com.au> |
---|---|
To: | firstname.lastname@gmail.com |
Subject: | Online Finance Application for FirstNameCheck (FirstNameCheck) MiddleName Last_Name VSSS 1572597 |
Sent: | 08-Apr-2019 15:10:43 |
Message-ID: | <155470024371.56988.15075359144788681573.online_application.784152.750.EVOv30.3.5 (DEVELOPMENT)@nlcsvrspk16b-t.headoffice.novationleasing.com.au> |
Contents (For Display Only - changes will NOT be saved)
<html>
<body>
<p>
Good Afternoon FirstNameCheck,
</p>
<p>
The link below will direct you to our on-line finance application so we can confirm your eligibility for your Novated Lease.<br/>
<br/>
<a href="https://novationleasing.com.au/?token=17fef55j0L-a6555147-59bc-11e9-bef5-00155da40d82">https://novationleasing.com.au/?token=17fef55j0L-a6555147-59bc-11e9-bef5-00155da40d82</a>
</p>
<p>
So we know that it is you and to protect your privacy, please have your mobile phone handy to complete the 2-step SMS
verification process before you get underway. 
</p>
<p>
We generally receive feedback from the financier within 24hrs, so as soon as we do, we will be in touch to advise you
of the outcome.
</p>
<p>
If you have any questions at all please do not hesitate to contact me on the details below.
</p>
<p>
Kind regards,
</p>
</body>
</html>