How can we upload image from URL in selenium











up vote
-1
down vote

favorite












image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
time.sleep(20)
image_upload = driver.find_element_by_id("url-uploaded-preview-img")
driver.execute_script("arguments[0].click();", image_upload)


I am getting this error may i know how can we upload the image from URL



Traceback (most recent call last):
File "F:/automation/check.py", line 38, in <module>
image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "F:automationvenvlibsite-packagesseleniumwebdriverremoteerrorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible









share|improve this question
























  • According to the error message the problem is, that there is no element with ID 'url-upload-input' visible.
    – Michael
    Nov 20 at 6:04










  • there is id with same name <input type="url" class="form-control" id="url-upload-input" placeholder="Provide an image URL">
    – sourav sharan
    Nov 20 at 6:08












  • Check print(len(driver.find_elements_by_id('url-upload-input'))). Is it 1?
    – Andersson
    Nov 20 at 6:12















up vote
-1
down vote

favorite












image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
time.sleep(20)
image_upload = driver.find_element_by_id("url-uploaded-preview-img")
driver.execute_script("arguments[0].click();", image_upload)


I am getting this error may i know how can we upload the image from URL



Traceback (most recent call last):
File "F:/automation/check.py", line 38, in <module>
image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "F:automationvenvlibsite-packagesseleniumwebdriverremoteerrorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible









share|improve this question
























  • According to the error message the problem is, that there is no element with ID 'url-upload-input' visible.
    – Michael
    Nov 20 at 6:04










  • there is id with same name <input type="url" class="form-control" id="url-upload-input" placeholder="Provide an image URL">
    – sourav sharan
    Nov 20 at 6:08












  • Check print(len(driver.find_elements_by_id('url-upload-input'))). Is it 1?
    – Andersson
    Nov 20 at 6:12













up vote
-1
down vote

favorite









up vote
-1
down vote

favorite











image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
time.sleep(20)
image_upload = driver.find_element_by_id("url-uploaded-preview-img")
driver.execute_script("arguments[0].click();", image_upload)


I am getting this error may i know how can we upload the image from URL



Traceback (most recent call last):
File "F:/automation/check.py", line 38, in <module>
image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "F:automationvenvlibsite-packagesseleniumwebdriverremoteerrorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible









share|improve this question















image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
time.sleep(20)
image_upload = driver.find_element_by_id("url-uploaded-preview-img")
driver.execute_script("arguments[0].click();", image_upload)


I am getting this error may i know how can we upload the image from URL



Traceback (most recent call last):
File "F:/automation/check.py", line 38, in <module>
image = driver.find_element_by_id('url-upload-input').send_keys('https://images.pexels.com/photos/67636/rose-blue-flower-rose-blooms-67636.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940')
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 479, in send_keys
'value': keys_to_typing(value)})
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "F:automationvenvlibsite-packagesseleniumwebdriverremotewebdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "F:automationvenvlibsite-packagesseleniumwebdriverremoteerrorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible






python selenium






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 at 8:38









ewwink

7,88222234




7,88222234










asked Nov 20 at 5:56









sourav sharan

124




124












  • According to the error message the problem is, that there is no element with ID 'url-upload-input' visible.
    – Michael
    Nov 20 at 6:04










  • there is id with same name <input type="url" class="form-control" id="url-upload-input" placeholder="Provide an image URL">
    – sourav sharan
    Nov 20 at 6:08












  • Check print(len(driver.find_elements_by_id('url-upload-input'))). Is it 1?
    – Andersson
    Nov 20 at 6:12


















  • According to the error message the problem is, that there is no element with ID 'url-upload-input' visible.
    – Michael
    Nov 20 at 6:04










  • there is id with same name <input type="url" class="form-control" id="url-upload-input" placeholder="Provide an image URL">
    – sourav sharan
    Nov 20 at 6:08












  • Check print(len(driver.find_elements_by_id('url-upload-input'))). Is it 1?
    – Andersson
    Nov 20 at 6:12
















According to the error message the problem is, that there is no element with ID 'url-upload-input' visible.
– Michael
Nov 20 at 6:04




According to the error message the problem is, that there is no element with ID 'url-upload-input' visible.
– Michael
Nov 20 at 6:04












there is id with same name <input type="url" class="form-control" id="url-upload-input" placeholder="Provide an image URL">
– sourav sharan
Nov 20 at 6:08






there is id with same name <input type="url" class="form-control" id="url-upload-input" placeholder="Provide an image URL">
– sourav sharan
Nov 20 at 6:08














Check print(len(driver.find_elements_by_id('url-upload-input'))). Is it 1?
– Andersson
Nov 20 at 6:12




Check print(len(driver.find_elements_by_id('url-upload-input'))). Is it 1?
– Andersson
Nov 20 at 6:12












1 Answer
1






active

oldest

votes

















up vote
0
down vote



accepted










Try to wait for element to be visible:



WebDriverWait(driver, 30).until(
EC.visibility_of_element_located((By.ID, "url-uploaded-preview-img"))
)





share|improve this answer





















    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53387049%2fhow-can-we-upload-image-from-url-in-selenium%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote



    accepted










    Try to wait for element to be visible:



    WebDriverWait(driver, 30).until(
    EC.visibility_of_element_located((By.ID, "url-uploaded-preview-img"))
    )





    share|improve this answer

























      up vote
      0
      down vote



      accepted










      Try to wait for element to be visible:



      WebDriverWait(driver, 30).until(
      EC.visibility_of_element_located((By.ID, "url-uploaded-preview-img"))
      )





      share|improve this answer























        up vote
        0
        down vote



        accepted







        up vote
        0
        down vote



        accepted






        Try to wait for element to be visible:



        WebDriverWait(driver, 30).until(
        EC.visibility_of_element_located((By.ID, "url-uploaded-preview-img"))
        )





        share|improve this answer












        Try to wait for element to be visible:



        WebDriverWait(driver, 30).until(
        EC.visibility_of_element_located((By.ID, "url-uploaded-preview-img"))
        )






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 21 at 17:20









        applekate

        345




        345






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53387049%2fhow-can-we-upload-image-from-url-in-selenium%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            404 Error Contact Form 7 ajax form submitting

            How to know if a Active Directory user can login interactively

            Refactoring coordinates for Minecraft Pi buildings written in Python