Usually that wouldn’t be a problem. I could work with __file__ , but I am packing my python script with pyinstaller to an .exe and if I then run the .exe, the path when running __file__, is a completly different one. Is there some way to get around this? I already did an installer for ..
I am having a small problem with my selenium automation script running on firefox. Every time I restart the container, I need to authenticate again. On chrome, I was able to use the cache, but not on Firefox. I did search for how to force firefox to use the cache, but or I am missing ..
I have tried xpath and CSS selector in build search buy id and class as well queries but am unable to click the Expand all button. The button I want to click Source: Python..
When I open the page https://www.dibbs.bsm.dla.mil/RFQ/RfqRecs.aspx?category=post&TypeSrch=dt&Value=09-25-2021 , this page asks for a confirmation button before proceeding. I can bypass that also. But when I tried to open this page from the selenium, this navigates to a different page https://www.dibbs.bsm.dla.mil//rfq/rfqrecs.aspx?category=post My code for this is: URL = ‘https://www.dibbs.bsm.dla.mil/RFQ/RfqRecs.aspx?category=post&TypeSrch=dt&Value=09-25-2021’ profile = webdriver.FirefoxProfile() driver=webdriver.Firefox(firefox_profile=profile,executable_path="geckodriver.exe") driver.get(URL) driver.find_element_by_id("butAgree").click() Source: Python ..
I have this python program made with selenium that automates a search on a firefox page, with a login and everything. The thing is, after the search is done, the program stops executing (the page is still open. I want it that way) but I want to somehow implement a function that when -given certain ..
I have written a simple selenium code that downloads files into the custom directory. The code is for firefox: profile = webdriver.FirefoxProfile() profile.set_preference("browser.download.folderList",2) # 0 for desktop # 1 for default download folder # 2 for specific folder # You can specify directory by using profile.set_preference("browser.download.dir","<>") profile.set_preference("browser.download.dir",dest_dir1) profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/octet-stream") profile.set_preference("browser.helperApps.alwaysAsk.force", False); # If you don’t ..
I was trying to find out how to save and load credentials when login into telegram web with selenium firefox/chrome driver. But telegram stores that information in browser profile. Now what i tried pickle.dump(driver.get_cookies(), open(location, "wb")) and for load cookies cookies = pickle.load(open(location, "rb")) driver.delete_all_cookies() driver.get("https://google.com" if url is None else url) for cookie in ..
I have some selenium code which is always throwing up this exception: Error: [(‘C:UsersuserAppDataRoamingMozillaFirefoxProfilestp3cz5dm.default-releasestoragedefaultmoz-extension+++81745d9e-096f-4b18-ad35-c2ef2dcf93e4^userContextId=4294967295idb3647222921wleabcEoxlt-eengsairo.sqlite-shm’, ‘C:UsersuserAppDataLocalTemptmp5h3p7xuzwebdriver-py-profilecopystoragedefaultmoz-extension+++81745d9e-096f-4b18-ad35-c2ef2dcf93e4^userContextId=4294967295idb3647222921wleabcEoxlt-eengsairo.sqlite-shm’, ‘[Errno 13] Permission denied’)] This error just seems to go away when I run the file again or the loop again. I do have an try and except statement to catch it: except (InvalidSessionIdException, Error): print("Restarting due to Exception InvalidSessionIdException") ..
how can i select this button from list element using selenium and click it? this the html <li class="ml1 sel"> <a href="#__about.htm" id="about_page" onclick="return menuClick(this);" class="T sel"> <span>about us</span> </a> </li> I have tried to use xpath css selector id and class name but always get error selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: Is there ..
I am trying to extract the stock market related data from the web browser. I am able to open the web browser and extract the data for one stock. Below is the python code for “One stock” which opens the web browser with Selenium Webdriver and extract the data from the web page using the ..