Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
open a web page by selenium !!
#1
hello folks ... i hope all okay ?

i try to visit a website via selenium but it did not work :

from selenium import webdriver
qassam = "http://ign.com"

dev = webdriver.Firefox()

dev.get(qassam)
it just open my browser not visited the website ??
and is there anyway to hide the browser ?


ps: my os is Linux evilcode1 4.4.0-130-generic #156~14.04.1-Ubuntu SMP Thu Jun 14 13:51:47 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Reply
#2
Use the headless option, see: https://python-forum.io/Thread-Web-scrap...t=selenium
Reply
#3
(Jul-30-2018, 10:58 AM)Larz60+ Wrote: Use the headless option, see: https://python-forum.io/Thread-Web-scrap...t=selenium
not working when i run the code its juts open my browser without doing anything
Reply
#4
That's the old way webdriver.Firefox() Firefox has messed it up some with DesiredCapabilities
And marionette can be True or False based on Firefox version.
This work for me,this setup is also in link over in my tutorial.
Now do i have geckodriver is folder as scripts.
from selenium import webdriver

#-- FireFox
caps = webdriver.DesiredCapabilities().FIREFOX
caps["marionette"] = True
browser = webdriver.Firefox(capabilities=caps)
url = "http://ign.com"
browser.get(url)
Chrome is easier.
from selenium import webdriver

#-- Chrome
browser = webdriver.Chrome()
url = "http://ign.com"
browser.get(url)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need help for script access via webdriver to an open web page in Firefox Clixmaster 1 1,255 Apr-20-2023, 05:27 PM
Last Post: farshid
  Click on a button on web page using Selenium Pavel_47 7 4,679 Jan-05-2023, 04:20 AM
Last Post: ellapurnellrt
  Selenium/Helium loads up a blank web page firaki12345 0 2,043 Mar-23-2021, 11:51 AM
Last Post: firaki12345
  Saving html page and reloading into selenium while developing all xpaths Larz60+ 4 4,172 Feb-04-2021, 07:01 AM
Last Post: jonathanwhite1
  Selenium Parsing (unable to Parse page after loading) oneclick 7 6,000 Oct-30-2020, 08:13 PM
Last Post: tomalex
  Can't open Amazon page Pavel_47 3 3,180 Oct-21-2020, 09:13 AM
Last Post: Aspire2Inspire
  Selenium Page Object Model with Python Cryptus 5 3,968 Aug-19-2020, 06:30 AM
Last Post: mlieqo
  Selenium on Angular page Martinelli 3 5,698 Jul-28-2020, 12:40 PM
Last Post: Martinelli
  Selenium won't open a link Justin2444 2 5,829 Apr-07-2020, 09:46 AM
Last Post: Larz60+
  use Xpath in Python :: libxml2 for a page-to-page skip-setting apollo 2 3,625 Mar-19-2020, 06:13 PM
Last Post: apollo

Forum Jump:

User Panel Messages

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