wkeeling / selenium-wire

Extends Selenium's Python bindings to give you the ability to inspect requests made by the browser.
MIT License
1.9k stars 251 forks source link

Embedding selenium-wire in ASP.NET C#: `set_wakeup_fd only works in main thread of the main interpreter` #653

Open calebTree opened 1 year ago

calebTree commented 1 year ago

I have embedded Python in an ASP.NET Framework API C# app using Python.NET and am attempting to use the selenium-wire library. To do this I have learned a little about the Python GIL. What I understand, is one key to embedding Python in another language is the Python engine must be initialized in the "main thread" (stack overflow answer). ASP.NET is inherently multi-threaded and Python is initialized in the Global.asax.cs Application_Start() which is ostensibly equivalent to the main() method.

Bugs: