Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Searching yahoo with selenium
#10
res will return None as mention.
This is not how you send source to BS,it's done by using browser.page_source.
If i test it also have to push agree button before can move on.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import bs4
 
browser = webdriver.Chrome()
browser.get('http://www.yahoo.com')
assert 'Yahoo' in browser.title
 
agree =  browser.find_element_by_xpath('/html/body/div[1]/div[2]/div[4]/div/div[2]/form[1]/div/input')
agree.click()
elem = browser.find_element_by_name('p') # find the search box
res = elem.send_keys('seleniumhq' + Keys.RETURN)
print(repr(res))
Output:
None
It should look like this.
soup = bs4.BeautifulSoup(browser.page_source, "html.parser")
Reply


Messages In This Thread
Searching yahoo with selenium - by Truman - Oct-10-2018, 11:54 PM
RE: Searching yahoo with selenium - by Larz60+ - Oct-11-2018, 02:53 AM
RE: Searching yahoo with selenium - by Truman - Oct-11-2018, 09:09 PM
RE: Searching yahoo with selenium - by nilamo - Oct-11-2018, 09:20 PM
RE: Searching yahoo with selenium - by Truman - Oct-11-2018, 09:36 PM
RE: Searching yahoo with selenium - by nilamo - Oct-11-2018, 09:37 PM
RE: Searching yahoo with selenium - by Truman - Oct-11-2018, 09:57 PM
RE: Searching yahoo with selenium - by nilamo - Oct-11-2018, 10:02 PM
RE: Searching yahoo with selenium - by Truman - Oct-11-2018, 10:10 PM
RE: Searching yahoo with selenium - by snippsat - Oct-12-2018, 02:23 AM
RE: Searching yahoo with selenium - by Truman - Oct-12-2018, 09:50 PM
RE: Searching yahoo with selenium - by Larz60+ - Oct-12-2018, 11:00 PM
RE: Searching yahoo with selenium - by Truman - Oct-12-2018, 11:13 PM
RE: Searching yahoo with selenium - by metulburr - Oct-12-2018, 11:02 PM
RE: Searching yahoo with selenium - by snippsat - Oct-12-2018, 11:09 PM
RE: Searching yahoo with selenium - by snippsat - Oct-13-2018, 12:50 AM
RE: Searching yahoo with selenium - by Truman - Oct-13-2018, 09:45 PM
RE: Searching yahoo with selenium - by snippsat - Oct-13-2018, 10:44 PM
RE: Searching yahoo with selenium - by Truman - Oct-13-2018, 10:59 PM
RE: Searching yahoo with selenium - by snippsat - Oct-13-2018, 11:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Web Scraping with Yahoo Finance miloellison 1 2,135 Jul-03-2020, 11:12 PM
Last Post: Larz60+
  getting financial data from yahoo finance asiaphone12 7 7,238 Jun-15-2020, 05:49 AM
Last Post: mick_g
  Scrap Yahoo Finance using BS4 mr_byte31 7 6,417 Aug-24-2018, 02:50 PM
Last Post: Larz60+
  webscraping yahoo data - custom date implementation Jens89 4 5,275 Jun-19-2018, 08:02 AM
Last Post: Jens89
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,768 Nov-03-2017, 08:41 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020