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'))
Comments
Post a Comment