Error With Selenium: AttributeError: 'WebDriver' object has no attribute 'Firefox'How to sort a list of objects based on an attribute of the objects?How to know if an object has an attribute in PythonAttributeError: 'module' object has no attributeHow to take screenshot with Selenium WebDriverGet HTML Source of WebElement in Selenium WebDriver using PythonError: “ 'dict' object has no attribute 'iteritems' ”why python selenium does not fill URLNot being able to navigate using webdriver from Selenium for PythonAttributeError: 'module' object has no attribute 'webdriver' seleniumselenium python webscraping
Why would company (decision makers) wait for someone to retire, rather than lay them off, when their role is no longer needed?
How come Arya Stark wasn't hurt by this in Game of Thrones Season 8 Episode 5?
What should I wear to go and sign an employment contract?
Lock out of Oracle based on Windows username
I recently started my machine learning PhD and I have absolutely no idea what I'm doing
Why are there five extra turns in tournament Magic?
What's is the easiest way to purchase a stock and hold it
Why didn't Daenerys' advisers suggest assassinating Cersei?
multicol package causes underfull hbox
French equivalent of the German expression "flöten gehen"
Was Tyrion always a poor strategist?
Appropriate liquid/solvent for life in my underground environment on Venus
How do we explain the use of a software on a math paper?
Can the word crowd refer to just 10 people?
Does a windmilling propeller create more drag than a stopped propeller in an engine out scenario
What technology would Dwarves need to forge titanium?
Combining two Lorentz boosts
Is my company merging branches wrong?
Shortest amud or daf in Shas?
When did Britain learn about the American Declaration of Independence?
Why is the S-duct intake on the Tu-154 uniquely oblong?
Divisor Rich and Poor Numbers
Can an airline pilot be prosecuted for killing an unruly passenger who could not be physically restrained?
Why is choosing a suitable thermodynamic potential important?
Error With Selenium: AttributeError: 'WebDriver' object has no attribute 'Firefox'
How to sort a list of objects based on an attribute of the objects?How to know if an object has an attribute in PythonAttributeError: 'module' object has no attributeHow to take screenshot with Selenium WebDriverGet HTML Source of WebElement in Selenium WebDriver using PythonError: “ 'dict' object has no attribute 'iteritems' ”why python selenium does not fill URLNot being able to navigate using webdriver from Selenium for PythonAttributeError: 'module' object has no attribute 'webdriver' seleniumselenium python webscraping
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm trying to run the code below, which I believe should work, but I'm actually getting this error:
AttributeError: 'WebDriver' object has no attribute 'Firefox'
def main():
import csv
import os
import selenium
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
wd = webdriver.Firefox(executable_path="C:/Utility/geckodriver.exe", firefox_profile=profile)
ticker = input("Enter your ticker: ")
url = "http://financials.morningstar.com/cash-flow/cf.html?t=" + ticker.upper()
print(url)
browser = wd.Firefox()
browser.get(url)
values_elementticker = browser.find_elements_by_xpath("//span[@class='gry']")
values2 = values = [x.text for x in values_elementticker]
print(values2[0])
values_element = browser.find_elements_by_xpath("//div[@id='data_i97']")
values = [x.text for x in values_element]
print("Cash Flows:")
print(values[0])
with open("C:\Users\Excel\Desktop\results.xls", "a") as f:
for i in range(len(values2)):
f.write(values2[0] + "n")
for i in range(len(values)):
f.write(values[0] + "n")
browser.close()
restart = input("Do you wish to start again?").lower()
if restart == "yes":
main()
else:
exit()
main()
The error is thrown immediately after I enter a valid ticker. Does this work for others? Or, is something wrong with the code? It looks OK to me. Thanks.
python python-2.7 selenium geckodriver
add a comment |
I'm trying to run the code below, which I believe should work, but I'm actually getting this error:
AttributeError: 'WebDriver' object has no attribute 'Firefox'
def main():
import csv
import os
import selenium
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
wd = webdriver.Firefox(executable_path="C:/Utility/geckodriver.exe", firefox_profile=profile)
ticker = input("Enter your ticker: ")
url = "http://financials.morningstar.com/cash-flow/cf.html?t=" + ticker.upper()
print(url)
browser = wd.Firefox()
browser.get(url)
values_elementticker = browser.find_elements_by_xpath("//span[@class='gry']")
values2 = values = [x.text for x in values_elementticker]
print(values2[0])
values_element = browser.find_elements_by_xpath("//div[@id='data_i97']")
values = [x.text for x in values_element]
print("Cash Flows:")
print(values[0])
with open("C:\Users\Excel\Desktop\results.xls", "a") as f:
for i in range(len(values2)):
f.write(values2[0] + "n")
for i in range(len(values)):
f.write(values[0] + "n")
browser.close()
restart = input("Do you wish to start again?").lower()
if restart == "yes":
main()
else:
exit()
main()
The error is thrown immediately after I enter a valid ticker. Does this work for others? Or, is something wrong with the code? It looks OK to me. Thanks.
python python-2.7 selenium geckodriver
3
browser = wd.Firefox()
remove this line and just changewd
tobrowser
in this linebrowser = webdriver.Firefox(executable_path="C:/Utility/geckodriver.exe", firefox_profile=profile)
– supputuri
Mar 23 at 17:17
Yeah, that works for me. Thanks.
– ryguy72
Mar 23 at 20:16
add a comment |
I'm trying to run the code below, which I believe should work, but I'm actually getting this error:
AttributeError: 'WebDriver' object has no attribute 'Firefox'
def main():
import csv
import os
import selenium
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
wd = webdriver.Firefox(executable_path="C:/Utility/geckodriver.exe", firefox_profile=profile)
ticker = input("Enter your ticker: ")
url = "http://financials.morningstar.com/cash-flow/cf.html?t=" + ticker.upper()
print(url)
browser = wd.Firefox()
browser.get(url)
values_elementticker = browser.find_elements_by_xpath("//span[@class='gry']")
values2 = values = [x.text for x in values_elementticker]
print(values2[0])
values_element = browser.find_elements_by_xpath("//div[@id='data_i97']")
values = [x.text for x in values_element]
print("Cash Flows:")
print(values[0])
with open("C:\Users\Excel\Desktop\results.xls", "a") as f:
for i in range(len(values2)):
f.write(values2[0] + "n")
for i in range(len(values)):
f.write(values[0] + "n")
browser.close()
restart = input("Do you wish to start again?").lower()
if restart == "yes":
main()
else:
exit()
main()
The error is thrown immediately after I enter a valid ticker. Does this work for others? Or, is something wrong with the code? It looks OK to me. Thanks.
python python-2.7 selenium geckodriver
I'm trying to run the code below, which I believe should work, but I'm actually getting this error:
AttributeError: 'WebDriver' object has no attribute 'Firefox'
def main():
import csv
import os
import selenium
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
wd = webdriver.Firefox(executable_path="C:/Utility/geckodriver.exe", firefox_profile=profile)
ticker = input("Enter your ticker: ")
url = "http://financials.morningstar.com/cash-flow/cf.html?t=" + ticker.upper()
print(url)
browser = wd.Firefox()
browser.get(url)
values_elementticker = browser.find_elements_by_xpath("//span[@class='gry']")
values2 = values = [x.text for x in values_elementticker]
print(values2[0])
values_element = browser.find_elements_by_xpath("//div[@id='data_i97']")
values = [x.text for x in values_element]
print("Cash Flows:")
print(values[0])
with open("C:\Users\Excel\Desktop\results.xls", "a") as f:
for i in range(len(values2)):
f.write(values2[0] + "n")
for i in range(len(values)):
f.write(values[0] + "n")
browser.close()
restart = input("Do you wish to start again?").lower()
if restart == "yes":
main()
else:
exit()
main()
The error is thrown immediately after I enter a valid ticker. Does this work for others? Or, is something wrong with the code? It looks OK to me. Thanks.
python python-2.7 selenium geckodriver
python python-2.7 selenium geckodriver
asked Mar 23 at 17:01
ryguy72ryguy72
4,6671826
4,6671826
3
browser = wd.Firefox()
remove this line and just changewd
tobrowser
in this linebrowser = webdriver.Firefox(executable_path="C:/Utility/geckodriver.exe", firefox_profile=profile)
– supputuri
Mar 23 at 17:17
Yeah, that works for me. Thanks.
– ryguy72
Mar 23 at 20:16
add a comment |
3
browser = wd.Firefox()
remove this line and just changewd
tobrowser
in this linebrowser = webdriver.Firefox(executable_path="C:/Utility/geckodriver.exe", firefox_profile=profile)
– supputuri
Mar 23 at 17:17
Yeah, that works for me. Thanks.
– ryguy72
Mar 23 at 20:16
3
3
browser = wd.Firefox()
remove this line and just change wd
to browser
in this line browser = webdriver.Firefox(executable_path="C:/Utility/geckodriver.exe", firefox_profile=profile)
– supputuri
Mar 23 at 17:17
browser = wd.Firefox()
remove this line and just change wd
to browser
in this line browser = webdriver.Firefox(executable_path="C:/Utility/geckodriver.exe", firefox_profile=profile)
– supputuri
Mar 23 at 17:17
Yeah, that works for me. Thanks.
– ryguy72
Mar 23 at 20:16
Yeah, that works for me. Thanks.
– ryguy72
Mar 23 at 20:16
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55316206%2ferror-with-selenium-attributeerror-webdriver-object-has-no-attribute-firefo%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55316206%2ferror-with-selenium-attributeerror-webdriver-object-has-no-attribute-firefo%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
browser = wd.Firefox()
remove this line and just changewd
tobrowser
in this linebrowser = webdriver.Firefox(executable_path="C:/Utility/geckodriver.exe", firefox_profile=profile)
– supputuri
Mar 23 at 17:17
Yeah, that works for me. Thanks.
– ryguy72
Mar 23 at 20:16