“Questions seeking debugging help (“Why isn’t this code working?”) must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself.” The desired behavior is to create an output file of scraped pages as per this working code (in non headless mode) and here’s the shortest code necessary to reproduce
Lets say I have an element When I am fetching the element by classname This gives me What I wanted was just ₹199. Note that I can’t just format the text and get the first text on split by space as the structure of the page keeps changing. Answer Using little bit JS: Output: What we are doing with JS
I’m fairly new to coding with Python and I had some questions regarding Selenium: So basically what I’m trying is: -user inputs multiple links to different sites -the script opens the first link and closes the browser afterwards and opens the next link -the user only inputs for example ‘google.com’ but the browser automatically opens ‘http://google.com’ (thats the reason why
I’m trying to retrieve the html of the webpage, click the next button, then repeat that action until the last page is reached. I want to get all of the articles’ headlines (h2) by the way, only managed to retrieve some portion of it. Here is my code : Here is the result As you can see, it only retrieves
Each time that I initiate a new webdriver the following text is written to the console: My goal was to stop selenium from printing this message to the console. Stack Overflow threads with similar topics to this one showed two options that did not work for me. The first one is: and the second one is: Both of these solutions
Whatever I do, the files keep getting printed into my Downloads (Windows default) folder, rather than specified folder. I did my research and apparently the savefile.default_directory option should be used rather than download.default_directory but it doesn’t work anyway. I tried removing the trailing \ from the path with no success. This is on a work PC if it makes any
I have a script that uses Selenium Python to download a PDF page made based on this question My goal at the moment is to change the name of this file so that it is located with the name I chose and then change the destination folder of the saved file. My doubts are: Where should I change so that
I’m trying to extract information from this page: I’m trying to extract the time (6:30 PM). My strategy is to find the second instance of the date (Mar. 31st, 2022), and then get the first sibling of that. Photo here (I want the part boxed in yellow): Here’s what I’ve tried: However, this is not getting me what I want.
I have a cod. I have a docker + python + pytest + selenium + Chrome + selenium host and prefs But it doesn’t work. I want save to file without dialog window. But test don`t save files. How can I understand the reason? And… Downloading files works on Windows, but not docker on linux. P.S I have this path
https://www.bccard.com/app/merchant/Login.do I am trying to login to this site automatically using Python-Selenium. However, as you might noticed the password input place is not receiving driver….