开发者

How can I dispatch Firefox or Google Chrome with Python?

开发者 https://www.devze.com 2022-12-30 04:42 出处:网络
How can I do this with Firefox or Google Chrome? ie = win32com.client.Dispatch(\'InternetExplorer.Application\')

How can I do this with Firefox or Google Chrome?

ie = win32com.client.Dispatch('InternetExplorer.Application')
ie.visible = 1
ie.navigate('http://google.com')

Is there a way to do it?

ps: I need to use the ReadyState with it... for example while (ie.ReadyState != 4):, or in other words, I need some command that wait unt开发者_开发技巧il the page loads completely until do the next command, that's why I need the dispatch, that currently work very good with IE


Firefox does not expose a COM object; this is not possible. (AFAIK)

You can use the webbrowser module to open a URL in the user's default browser.


Have a look at the webbrowser module in the Python standard library.

0

精彩评论

暂无评论...
验证码 换一张
取 消