The website I run my headless (PhantomJS) browser through Selenium has different timezone so I get the wrong dates for many entries. Thus my scraped results show the wrong dates/times (i'm in EST, looks like website default is GMT).
I'm scraping from this website. You can get an idea of how i'm scraping dates through a previous question on SO here. Note however i'm not currently scraping the times of games so i'd prefer not to incorporate this in a solution.
The same question is asked here but I don't know how to test the 'obvious' solution of checking to see what time the website is defaulting to. I suppose one would request a time from the client and add/subtract hours from my current time? Can someone please tell me how to do that and/or if there's a better way.
Edit: what I want is to change the website scraped data from the default (GMT) to my time (EST). This will avoid having to mess with adding hours; the dates will reflect what they are for me.
Here's as far as i've gotten:
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
#from selenium.webdriver.support.select import Select
driver = webdriver.PhantomJS(executable_path=r'C:/phantomjs.exe')
driver.get('http://www.oddsportal.com/hockey/usa/nhl/results/')
zoneDropDownID = "timezone-content"
driver.implicitly_wait(5)
zoneDropDownElement = WebDriverWait(driver, 10).until(lambda driver: driver.find_element_by_id(zoneDropDownID))
# Select(zoneDropDownID).select_by_visible_text("Eastern") # strobject has no attribute
test = zoneDropDownID.select_by_visible_text("Eastern").click() # TimeOut exception - not found
driver.close()
But I can't get it to click. Should I be searching for a class instead?