How to run Headless Selenium C#

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to this video in this video i will teach you how to make selenium run in headless mode and running selenium in headless mode basically means that no ui is shown so i've created this very simple web scraper which goes to the football wikipedia page and finds the first paragraph which contains text and then prints it out and i'll just show you how it works when it runs as you can see it printed out this text now if we don't want this ui to be shown we will simply add some chrome options and then we'll add an argument which is called um headless i mean headless and then we obviously add the options and that's basically it now if we run this no ui is shown and the text will be printed out but as you can see some other text is also printed out now and this text is actually from the javascript console which you can see if i just comment out this these options there you go now it runs and then if you press f12 it goes to the console this is the same text so yeah for us to remove this we simply add another argument if i can type unlock level equals three and then we run it and no text except for the paragraph should be printed and yeah now this is for chrome we use the chrome driver and chrome options but if you use firefox you simply use the firefox options and obviously the firefox driver and you would still use headless dash headless and then we can print it out i mean run it and then it should be printed out the same way and as you can see it takes a bit longer on firefox than when you use chrome and that's primarily why i use chrome normally but it printed out the text so yeah i hope this helped some of you and please like and subscribe if you want me to continue making these kinds of videos
Info
Channel: Scrapax
Views: 1,208
Rating: 5 out of 5
Keywords: Headless, Selenium, Web Scraping, Automation, Bot, C#, .net
Id: P7KigYDRhPg
Channel Id: undefined
Length: 3min 5sec (185 seconds)
Published: Tue Sep 22 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.