![]() I can successfully loop through the xpaths. Using the length of the array, I know how many values to expect. for times in all_times: text = times.text timeRemaining.append(text) Then, looped through each, and saved the text to an array. Then, I searched for elements in that section by class name : all_times = items.find_elements(By.CLASS_NAME,"time") ![]() So, I saved the main section to a variable : items = driver.find_element(By.XPATH,"/html/body/main/section/section/div/div/div/section/div/ul") html/body/main/section/section/div/div/div/section/div/ul/li/div/div/div/span/html/body/main/section/section/div/div/div/section/div/ul/li/div/div/div/span/html/body/main/section/section/div/div/div/section/div/ul/li/div/div/div/span In each of the li's above.there is another span class. Id rather do this the right way so I can begin to understand how to troubleshoot stuff like this in the future. I did make it work, but it's a hack job. I need to loop through each li, and grab the span.text. The XPATHs look like this : /html/body/main/section/section/div/div/div/section/div/ul/li/div/div/div/span/html/body/main/section/section/div/div/div/section/div/ul/li/div/div/div/span/html/body/main/section/section/div/div/div/section/div/ul/li/div/div/div/span I have an unknown number of span classes I want to loop through. ![]() I'm working with Selenium/Python for the first time and I'm having trouble wrapping my brain around a specific problem. ChromeOptions options = new ChromeOptions() Proxy proxy = new Proxy() proxy.Kind = ProxyKind.Manual proxy.HttpProxy =proxy.SslProxy = "server:port" options.Proxy = proxy // setting credentials likevar driverService = ChromeDriverService.CreateDefaultService() driverService.HideCommandPromptWindow = true var driver = new ChromeDriver(driverService, options) NetworkAuthenticationHandler handler = new NetworkAuthenticationHandler() ) def closed(self, reason): # Close the browser when the spider is closed () ![]() when I set HTTP proxy it work, but when I set socks5 proxy it do not work. I am using selenium c# library and trying to set proxy. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |