from selenium import webdriver
driver = webdriver.Firefox()
url = 'https://www.yahoo.co.jp/'
driver.get("https://tool-taro.com/wget/")
elem = driver.find_element_by_name("value")
elem.clear()
elem.send_keys(url)
elem = driver.find_element_by_class_name("lockable")
elem.click()
elem = driver.find_element_by_name("title")
title = elem.get_attribute("value")
print(title)
elem = driver.find_element_by_name("result")
value = elem.get_attribute("value")
print(value)
Pyppeteer
import asyncio
from pyppeteer import launch
async def main():
browser = await launch()
page = await browser.newPage()
await page.goto('https://tool-taro.com/wget/')
await page.type('div.box_whois_l.box_wget03 > input[type="text"]',
'https://www.yahoo.co.jp/')
await page.click('div.box_whois_r > div > input')
await page.waitFor(3000)
element = await page.querySelector('#new > div.box_wget01 > textarea')
title = await page.evaluate('(element) => element.value', element)
element = await page.querySelector('#new > div.box_wget02 > textarea')
description = await page.evaluate('(element) => element.value', element)
print(title)
print(description)
await page.screenshot({'path': 'example.png'})
await browser.close()
asyncio.get_event_loop().run_until_complete(main())