Skip to content
This repository has been archived by the owner on Jun 22, 2022. It is now read-only.

Incompatibility with JuPyter Notebook (Playwright ASync API) #44

Open
danielkmetz opened this issue Jun 30, 2021 · 6 comments
Open

Incompatibility with JuPyter Notebook (Playwright ASync API) #44

danielkmetz opened this issue Jun 30, 2021 · 6 comments
Labels
bug Something isn't working indefinite timetable Completion status unknown

Comments

@danielkmetz
Copy link

Hey guys,

I apologize if this is annoying. I'm having issues understanding how to actually run the code in a jupyter notebook to scrape the table from the URL at the bottom of this post. When I try and run the code from the example I keep getting an error that reads "It looks like you are using Playwright Sync API inside the asyncio loop. Please use the Async API instead.". Would someone be willing to show me the code I would need to run to get that table? Any help would be greatly appreciated.

https://www.fangraphs.com/leaders/splits-leaderboards?splitArr=42&splitArrPitch=&position=P&autoPt=false&splitTeams=false&statType=player&statgroup=1&startDate=2021-03-01&endDate=2021-11-01&players=&filter=&groupBy=game&sort=-1,1

@JacobLee23
Copy link
Owner

According to this issue on the Playwright-Python GitHub repository, when using JuPyter Notebook, the asynchronous Playwright API must be used.

I was notified recently of this issue when I myself tried to use this software in JuPyter. Right now, the fangraphs package uses the Playwright Sync API, not the Playwright ASync API. Lately, I've been refactoring the package so that the various configurations occur during instantiation (as opposed to after instantiation), which would allow for support for the Playwright ASync API. It might take a while, but I'll mention the Pull Request in this issue when it is resolved.

@JacobLee23 JacobLee23 added the bug Something isn't working label Jun 30, 2021
@JacobLee23 JacobLee23 changed the title Help Incompatibility with JuPyter Notebook (Playwright ASync API) Jun 30, 2021
@danielkmetz
Copy link
Author

Thanks for the fast response! Can't wait for the update!

@danielkmetz
Copy link
Author

Hey Jacob,

Have you found a solution to this bug?

@JacobLee23
Copy link
Owner

Sorry it's taking so long. I've been held up with other stuff for the past few weeks, but I've been slowly making progress locally. Hopefully I'll have a solution by mid-August, but I'll get to work pushing my commits here these next two weeks.

@danielkmetz
Copy link
Author

How's it coming?

@JacobLee23
Copy link
Owner

I'm so sorry it's taking so long. I know what code I need to write, but I've been so held up with school that I haven't been able to write the code. I don't know an exact timetable for completion, but I, personally, want to get it done before playoff season.

@JacobLee23 JacobLee23 added the indefinite timetable Completion status unknown label Sep 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working indefinite timetable Completion status unknown
Projects
None yet
Development

No branches or pull requests

2 participants