Python Selenium Get PageSource of XHTML -


i wondering if there way print entire html path. trying verify text in pdf xhtml file pop-up , can not to. hope entire page source , verify text in there. .page_source seems give me url , description , looking each line of code.

a possible approach make selenium find starting page tag (html) , source related code.

driver = webdriver.firefox() driver.get("http://stackoverflow.com/") driver.find_element_by_tag_name("html").get_attribute('outerhtml') 

documentation

output example:

<html webdriver="true"><head>  <title>stack overflow</title>     <link rel="shortcut icon" href="https://cdn.sstatic.net/sites/stackoverflow/img/favicon.ico?v=4f32ecc8f43d">     <link rel="apple-touch-icon image_src" href="https://cdn.sstatic.net/sites/stackoverflow/img/apple-touch-icon.png?v=c78bd457575a">     <link rel="search" type="application/opensearchdescription+xml" title="stack overflow" href="/opensearch.xml">     <meta name="twitter:card" content="summary">     <meta name="twitter:domain" content="stackoverflow.com">     <meta property="og:type" content="website">     <meta name="description" content="stack overflow largest online community programmers learn, share knowledge, , advance careers">      <meta property="og:image" itemprop="image primaryimageofpage" content="https://cdn.sstatic.net/sites/stackoverflow/img/apple-touch-icon@2.png?v=73d79a89bded">     <meta name="twitter:title" property="og:title" itemprop="title name" content="stack overflow">     <meta name="twitter:description" property="og:description" itemprop="description" content="q&amp;a professional , enthusiast programmers">     <meta property="og:url" content="http://stackoverflow.com/">  ...... 

Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -