Created
July 15, 2020 16:35
-
-
Save benjaminguinaudeau/99e03118a1208280b7e6921d5a1f9549 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import pyppeteer | |
class poker: | |
def __init__(self, endpoint): | |
self.endpoint = endpoint | |
loop = asyncio.new_event_loop() | |
loop.run_until_complete(self.start()) | |
async def start(self): | |
browser = await pyppeteer.connect({'browserWSEndpoint': self.endpoint}) | |
pages = [] | |
for target in browser.targets(): | |
if target.type == 'page': | |
page = await target.page() | |
if page: | |
pages.append(page) | |
page = pages[0] | |
self.source = await page.evaluate('document.querySelector(".table_page").innerHTML') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment