Selenium is unable to extract page source and returning empty body of html page
Clash Royale CLAN TAG #URR8PPP Selenium is unable to extract page source and returning empty body of html page Here is my python code: import pandas as pd import pandas_datareader.data as web import bs4 as bs import urllib.request as ul from selenium import webdriver style.use('ggplot') driver = webdriver.PhantomJS(executable_path='C:\Phantomjs\bin\phantomjs.exe') def getBondRate(): #driver.deleteAllCookies(); url = "https://www.marketwatch.com/investing/index/tnx?countrycode=xx" driver.get(url) driver.implicitly_wait(10) html = driver.page_source return html bondRate = getBondRate() print(bondRate) Few days back it was reading perfectly fine from Market watch. Now it is returning nothing in Body tag. Is selenium not loading page? 2 Answers 2 Do you require the HTML tags also? If not, you can try retrieving using the body tag. Here's how I would do it using Java. String src=driver.findElement(By.tagName("body")).getText(); As per t...