I'm trying to scrape some javascript-generated content from a Chinese-language website. I'm using Selenium (and Python) since I can't scrape the javascript content directly.
# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.selenium import selenium
import time
import urllib2
import httplib
import urllib
import re
import base64
browser = webdriver.Firefox() # Get local session of firefox
browser.get("http://www...") # Load page (redacted here, but any works)
browser.get_body_text() #Attempt to scrape body text
And I get the following error:
'WebDriver' object has no attribute 'get_body_text'
In fact, I can't seem to call any commands in the selenium.selenium class. No doubt I'm overlooking something very obvious. Thanks in advance.
2.21.3this function is not availablefrom selenium.selenium import seleniumworksfrom selenium.selenium import seleniumis working here but not sure how else to import commands from that class. Certainly not throwing up errors and have seen others using this code.AttributeError: 'WebDriver' object has no attribute 'get_body_text'