from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
from bs4 import BeautifulSoup
driver = webdriver.PhantomJS()
#driver = webdriver.Firefox()
driver.get('http://global.ahnlab.com/site/securitycenter/securityinsight/securityInsightList.do')
driver.execute_script("getView('2218')")
html_source = driver.page_source
driver.quit()
soup = BeautifulSoup(html_source)
print(soup.h1.string)
When I use Firefox(), the result is [AhnLab Puts in Appearance at RSAConference for 4th Straight Year] that I want. But when I use PhanthomJS(), the result is [Security Insight] that I don't want.
If I use PhantomJS(), I can't get the result that I want? I want to get the first result using a headless browser.
thanks.