Uporabnik:Mihas-bot/purge.py
Videz
#/bin/env python import asyncio from pyppeteer import launch # pip install pyppeteer import re from lxml import html import datetime async def main(): uri = 'https://sl.wikipedia.org/w/index.php?title=Glavna_stran&action=purge' browser = await launch() page = await browser.newPage() await page.goto(uri) # Simulate click on the login button await page.evaluate('''() => { document.querySelector('.oo-ui-buttonElement-button.oo-ui-inputWidget-input').click(); }''') await page.waitForNavigation() #await page.screenshot({'path': 'screenshoot.png'}) await browser.close() asyncio.get_event_loop().run_until_complete(main())