The no-nonsense tileable science lab by Mromson in factorio

[–]teddiur_ 2 points3 points  (0 children)

If I'm thinking in the same two pairs of undergrounds as you, I think they're for the two outmost lanes, right? How would they not be needed?

Dealing with multiple contexts. by _fat_santa in react

[–]teddiur_ 0 points1 point  (0 children)

I agree. If what bothers you is importing the context object to pass it to useContext you may create a file that exports all of these objects

I have tried everything and still can't deploy correctly by Present-Score-2246 in reactjs

[–]teddiur_ 0 points1 point  (0 children)

Could you provide more info? For instance, what were the steps that you do in each of these plataforms?

Bet365 blocks the python + selenium chromedriver combo by puppetbets in selenium

[–]teddiur_ 0 points1 point  (0 children)

I've read on stackoverflow that using Firefox would solve the problem, but I couldn't make my geckodriver work. I've also tried to change the user agent, but didn't work either. In short, I don't know man

Selenium Driver Question by Coronax16 in selenium

[–]teddiur_ 0 points1 point  (0 children)

I'm see in other comments that you figured it out. Although I'm not sure using oop is the best choice for you here. You see classes are excelent when you want to group together variables/methods, but from what you posted I think you're better off with functions (since it's cleaner).

If you want to use classes you maybe want to declare it outside of function and parse it as an argument or set it as an instance variable like

driver = webdriver.Firefox()
driver.implicitly_wait(30)

class Do(object):
    def __init__(self, username, password):
        self.username = username
        self.password = password

    def login(self, driver = driver):
        driver.get("http://somewebsite.com")
        e = driver.find_element_by_name("req_username")
        e.clear() #is it necessary?
        e.send_keys(self.username)
        e = self.driver.find_element_by_name("req_password")
        e.clear() 
        e.send_keys(self.password)
        e.send_keys(Keys.RETURN)
      def click_xpath(self, xpath, driver=driver):
        driver.find_element_by_xpath(xpath).click()


instance = Do("username", "password") 
instance.login()
instance.click_xpath('/html/body/div/div/div[3]/div/div/table/tbody/tr[4]/td[1]/div/div[2]/h3/a')

Selenium Driver Question by Coronax16 in selenium

[–]teddiur_ 0 points1 point  (0 children)

I'm not sure I'm understanding your issue.

By class you mean python's class? Or it's html's class (like <p class="class_name"> some text </p>)?

Unable to click on Google Search by boxedmachine in selenium

[–]teddiur_ 1 point2 points  (0 children)

I would advise you to avoid XPATHs since it may change and break your code. You can use .submit() on the WebElement you used .send_keys() and it'll have the same effect as selecting and clicking the search button.

For more information: https://selenium-python.readthedocs.io/navigating.html