I want to open an and after opening the ,
I want to the xml content displayed in the webpage as 1.xml file.

What I tried:

from  import webdriver
import os
from .webdriver.common.action_chains import ActionChains
from .webdriver.common.keys import Keys

chromedriver = "/home/dipankar/Desktop/chromedriver"
os.environ["webdriver.chrome.driver"] = chromedriver
driver = webdriver.Chrome(chromedriver)

#driver = webdriver.Firefox()


saveas = ActionChains(driver).key_down(Keys.CONTROL).send_keys('S').key_up(Keys.CONTROL)

I tried the following code, but it downloads the html tags also. I want to download only the content displayed in the web page. Not the page source.

content = driver.page_source
print content

Here I attached screen shot of the sample webpage.

xml webpage

Source link https://sqa.stackexchange.com/questions/33407/how-to-save-an-webpage-as-a-xml-file-using--and-selenium


Please enter your comment!
Please enter your name here