[python-win32] equivalent selenium findElement(By.xpath...) with win32com
Tim Roberts
timr at probo.com
Wed Mar 9 13:12:18 EST 2016
laurent solano wrote:
>
> I had already identified and look at the documentation about splinter.
> Sound great, but there is one missing feature : i need to automate an
> already open browser, where i'm already log in.
>
> With win32com, i can do it. below my code:
You're doing this is in a somewhat unusual way. The COM server you're
accessing here is the Windows shell, when then indirectly finds a web
browser and opens it. Have you looked at the IEC module?
At the lowest level, you can do
ie = win32com.client.Dispatch("InternetExplorer.Application")
You can then use ie.Document to get the IHTMLDocument2 interface for the
visible tab. It's then possible to query through the DOM, although not
with the usual DOM methods.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list