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
  Selenium Parsing (unable to Parse page after loading) oneclick 7 1,526 Oct-30-2020, 08:13 PM
Last Post: tomalex
  Can't open Amazon page Pavel_47 3 282 Oct-21-2020, 09:13 AM
Last Post: Aspire2Inspire
  Selenium Page Object Model with Python Cryptus 5 462 Aug-19-2020, 06:30 AM
Last Post: mlieqo
  Selenium on Angular page Martinelli 3 471 Jul-28-2020, 12:40 PM
Last Post: Martinelli
  Selenium won't open a link Justin2444 2 873 Apr-07-2020, 09:46 AM
Last Post: Larz60+
  use Xpath in Python :: libxml2 for a page-to-page skip-setting apollo 2 752 Mar-19-2020, 06:13 PM
Last Post: apollo
  Selenium get data from newly accessed page hoff1022 2 753 Oct-09-2019, 06:52 PM
Last Post: hoff1022
  Difficult web page -- Selenium Larz60+ 2 903 Dec-31-2018, 06:51 PM
Last Post: Larz60+
  Firefox Selenium (open new tab) oneclick 1 3,271 Dec-29-2018, 06:59 AM
Last Post: hbknjr
  Web Page not opening while web scraping through python selenium sumandas89 4 4,960 Nov-19-2018, 02:47 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

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