html - How to get CSS Background Colour with Python? -


basically question says, i'm trying background colour out website.

at moment i'm using beautifulsoup html, it's proving difficult way of getting css. great!

this not can reliably solve beautifulsoup. need a real browser.

the simplest option use selenium browser automation tool:

from selenium import webdriver  driver = webdriver.firefox() driver.get('url')  element = driver.find_element_by_id('myid') print(element.value_of_css_property('background-color')) 

value_of_css_property() documentation.


Comments

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -