Selenium + Python දන්න කෙනෙක් ඉන්නවනම් මෙක පොඩ්ඩක් කියලා දියන්කෝ.

newbie22

Well-known member
  • Jun 9, 2022
    1,499
    2,336
    113
    මචන් Selenium + Python දන්න කෙනෙක් ඉන්නවනම් මෙක පොඩ්ඩක් කියලා දියන්කෝ.
    මේ පහළ code එක run කලහම Error එකක් එනවා. මේක එන්නේ undetected_edgedriver එක පාවිච්චි කරන කොට විතරයි. සාමාන්‍ය විදිහට webdriver එක පාවිච්චි කරද්දි එන්නේ නෑ. මුළු code එකම execute වෙලා ඉවර වුණාම තමයි Error එක එන්නේ. code එක run වෙලා ඉවර වුණු ගමන් Edge Browser එක close වෙලා console එකේ error එක එනවා.


    code එක 👇

    Python:
    import undetected_edgedriver as ue
    from selenium.webdriver.edge.options import Options
    import time
    
    if __name__ == '__main__':
        driver = ue.Edge(options=options)
        driver.get("https://google.com/")



    Error එක 👇

    Code:
    Exception ignored in: <function Patcher.__del__ at 0x000002615221F1A0>
    Traceback (most recent call last):
      File "C:\Users\Maduranga\AppData\Local\Programs\Python\Python311\Lib\site-packages\undetected_edgedriver\patcher.py", line 262, in __del__
    OSError: [WinError 6] The handle is invalid


    මීට කලින් පාවිච්චි කරද්දි මෙහෙම Error එකක් ඇවිත් නෑ. මම නෙට් එකේ බලලා සමහර solutions try කළා හරිගියේ නෑ.
     

    saw1993

    Well-known member
  • Aug 9, 2015
    1,704
    1,710
    113
    Kandy
    There are several possible reasons why this error might be occurring. Without more information about the code and its environment, it's difficult to say for sure what the issue might be. Here are a few possibilities:

    • The undetected_edgedriver module is not installed correctly or is not compatible with the version of Python you are using. You can try reinstalling the module to see if that fixes the problem.
    • The options variable used in the code is not defined. You will need to define this variable and initialize it with an instance of the Options class before calling the Edge constructor.
    • The Edge constructor is called with the wrong number of arguments. The Edge constructor expects a single argument, which should be an instance of the webdriver.EdgeOptions class (or a subclass of this class, such as the Options class from the selenium.webdriver.edge.options module). It is possible that you are passing the options variable as a keyword argument instead of as a positional argument.
    • The driver variable is not being closed properly after the driver.get call. In general, it is a good practice to call the quit method on a WebDriver instance when you are done using it, to ensure that all resources are released properly.
    By ChatGPT
     

    newbie22

    Well-known member
  • Jun 9, 2022
    1,499
    2,336
    113
    බමප්

    thank you bro (y)
    edge eka wenuwata chrome eka dagaththa eka wada :-)

    There are several possible reasons why this error might be occurring. Without more information about the code and its environment, it's difficult to say for sure what the issue might be. Here are a few possibilities:

    • The undetected_edgedriver module is not installed correctly or is not compatible with the version of Python you are using. You can try reinstalling the module to see if that fixes the problem.
    • The options variable used in the code is not defined. You will need to define this variable and initialize it with an instance of the Options class before calling the Edge constructor.
    • The Edge constructor is called with the wrong number of arguments. The Edge constructor expects a single argument, which should be an instance of the webdriver.EdgeOptions class (or a subclass of this class, such as the Options class from the selenium.webdriver.edge.options module). It is possible that you are passing the options variable as a keyword argument instead of as a positional argument.
    • The driver variable is not being closed properly after the driver.get call. In general, it is a good practice to call the quit method on a WebDriver instance when you are done using it, to ensure that all resources are released properly.
    By ChatGPT
    ado me ChatGPT eka fatta ne. mamath try karala baluwa errors ehema pahadili karala denawane. meka AI walin nam wenne google wage search engin ekakata ei ban meka use karanna bari?