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