N
N
Nicholas V2018-01-27 08:46:42
Python
Nicholas V, 2018-01-27 08:46:42

Is it possible to get the coordinates and dimensions of a flash element on a page?

There is a certain page (it doesn't matter, any) on which the rectangle of the flash element is displayed. It is necessary to determine its coordinates and dimensions. Are there modules in python that allow you to get such information from the loaded page? If possible with examples. )

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nicholas V, 2018-01-28
@Amunrah

In general, I found a solution, I'll leave it here, maybe it will be useful to someone else:

from selenium import webdriver

op = webdriver.ChromeOptions()
op.binary_location = 'Opera/launcher.exe' # путь к экзешнику оперы
browser = webdriver.Opera( options = op )
browser.get( 'https://site.com/page' )

coords = browser.execute_script( 'return some_id.getBoundingClientRect()' )

print( coords ) 
browser.quit()

A
Andrey Tsvetkov, 2018-01-27
@yellow79

If you have access to JavaScript, you can use getBoundingClientRect

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question