python html body,Python selenium : How to fetch html body text from iframe content

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_NameConsultant:Automation Test <automation.test> (Non - Sales)Lead:Novated Finance Lease, Vehicle purchase, LID315691 ( View/Edit,

Print/Email )

Quote:QID657319 MAZDA CX-7 CLASSIC SPORTS (4x4) ER MY10 JTL09J N/A Unleaded ( View/Edit,

Print/Email )

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

Annual:Pre Tax$8,400.51Post Tax$1,160.00After Tax Benefit$3,867.79Package Cost$9,560.51Hip Pocket Cost$6,284.51
Fortnightly:Pre Tax$323.10Post Tax$44.62After Tax Benefit$148.76Package Cost$367.72Hip Pocket Cost$241.71

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.&#160;

</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>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值