Python
- 2 ответа
- 0 вопросов
1
Вклад в тег
import asyncio
from arsenic import get_session, keys, browsers, services
async def hello_world():
service = services.Geckodriver()
browser = browsers.Firefox()
async with get_session(service, browser) as session:
await session.get('https://images.google.com/')
search_box = await session.wait_for_element(5, 'textarea[name="q"]')
await search_box.send_keys('Cats')
await search_box.send_keys(keys.ENTER)
await asyncio.sleep(10)
def main():
loop = asyncio.get_event_loop()
loop.run_until_complete(hello_world())
if __name__ == '__main__':
main()