Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can not download the PDF
#27
It doesn't help. The result is the same as before. Now here the whole code:

from selenium import webdriver
from bs4 import BeautifulSoup
import time
 
# Activate Phantom and deactivate Chrome to not load browser

caps = webdriver.DesiredCapabilities().FIREFOX
caps["marionette"] = False
browser = webdriver.Firefox(capabilities=caps)
web_url = 'http://technical.traders.com/sub/sublogin2.asp'
browser.get(web_url)

user_name = browser.find_element_by_css_selector('#SubID > input[type="text"]')
user_name.send_keys("Foo")
password = browser.find_element_by_css_selector('#SubName > input[type="text"]')
password.send_keys("Bar")
time.sleep(2)
submit = browser.find_element_by_css_selector('#SubButton > input[type="submit"]')
submit.click()
time.sleep(2)
 
# Give source code to BeautifulSoup
soup = BeautifulSoup(browser.page_source, 'lxml')
log_in = soup.find('h2')
print(log_in.text)

Here the out put after the browser closes:

runfile('D:/Temp/Selenium.py', wdir='D:/Temp')
Traceback (most recent call last):

File "<ipython-input-12-7d93cfa31c34>", line 1, in <module>
runfile('D:/Temp/Selenium.py', wdir='D:/Temp')

File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 880, in runfile
execfile(filename, namespace)

File "C:\ProgramData\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)

File "D:/Temp/Selenium.py", line 20, in <module>
browser = webdriver.Firefox(capabilities=caps)

File "C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 59, in __init__
self.binary, timeout),

File "C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\firefox\extension_connection.py", line 47, in __init__
self.binary.launch_browser(self.profile)

File "C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 64, in launch_browser
self._wait_until_connectable()

File "C:\ProgramData\Anaconda3\lib\site-packages\selenium\webdriver\firefox\firefox_binary.py", line 108, in _wait_until_connectable
self.profile.path, self._get_firefox_output()))

WebDriverException: Can't load the profile. Profile Dir: C:\Users\ADMINI~1\AppData\Local\Temp\2\tmpzuvl2fst Firefox output: None
Reply


Messages In This Thread
Can not download the PDF - by thomas2004ch - Aug-30-2017, 08:16 PM
RE: Can not download the PDF - by Larz60+ - Aug-30-2017, 08:44 PM
RE: Can not download the PDF - by thomas2004ch - Aug-31-2017, 04:29 AM
RE: Can not download the PDF - by snippsat - Aug-30-2017, 08:44 PM
RE: Can not download the PDF - by thomas2004ch - Aug-31-2017, 06:40 AM
RE: Can not download the PDF - by Larz60+ - Aug-31-2017, 07:10 AM
RE: Can not download the PDF - by snippsat - Aug-31-2017, 09:49 AM
RE: Can not download the PDF - by thomas2004ch - Aug-31-2017, 12:12 PM
RE: Can not download the PDF - by Larz60+ - Aug-31-2017, 12:19 PM
RE: Can not download the PDF - by snippsat - Aug-31-2017, 01:25 PM
RE: Can not download the PDF - by thomas2004ch - Aug-31-2017, 02:06 PM
RE: Can not download the PDF - by snippsat - Aug-31-2017, 02:40 PM
RE: Can not download the PDF - by thomas2004ch - Aug-31-2017, 04:46 PM
RE: Can not download the PDF - by nilamo - Aug-31-2017, 05:19 PM
RE: Can not download the PDF - by thomas2004ch - Aug-31-2017, 06:06 PM
RE: Can not download the PDF - by nilamo - Aug-31-2017, 06:21 PM
RE: Can not download the PDF - by thomas2004ch - Aug-31-2017, 07:06 PM
RE: Can not download the PDF - by snippsat - Aug-31-2017, 07:46 PM
RE: Can not download the PDF - by thomas2004ch - Sep-01-2017, 04:09 AM
RE: Can not download the PDF - by snippsat - Sep-01-2017, 12:05 PM
RE: Can not download the PDF - by thomas2004ch - Sep-01-2017, 03:16 PM
RE: Can not download the PDF - by snippsat - Sep-01-2017, 04:13 PM
RE: Can not download the PDF - by thomas2004ch - Sep-01-2017, 04:54 PM
RE: Can not download the PDF - by snippsat - Sep-01-2017, 05:09 PM
RE: Can not download the PDF - by thomas2004ch - Sep-01-2017, 06:02 PM
RE: Can not download the PDF - by snippsat - Sep-01-2017, 06:24 PM
RE: Can not download the PDF - by thomas2004ch - Sep-01-2017, 06:34 PM
RE: Can not download the PDF - by snippsat - Sep-01-2017, 07:22 PM
RE: Can not download the PDF - by thomas2004ch - Sep-01-2017, 07:58 PM
RE: Can not download the PDF - by snippsat - Sep-01-2017, 09:03 PM
RE: Can not download the PDF - by thomas2004ch - Sep-02-2017, 04:49 AM
RE: Can not download the PDF - by snippsat - Sep-02-2017, 08:25 AM
RE: Can not download the PDF - by thomas2004ch - Sep-02-2017, 11:06 AM
RE: Can not download the PDF - by snippsat - Sep-02-2017, 12:07 PM
RE: Can not download the PDF - by thomas2004ch - Sep-03-2017, 04:17 AM

Forum Jump:

User Panel Messages

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