How to upload files using Selenium WebDriver Python | Easiest Elements Trick | Native Selenium Way

Поділитися
Вставка
  • Опубліковано 1 лис 2024

КОМЕНТАРІ • 96

  • @TheHimanshuRastogi
    @TheHimanshuRastogi Рік тому +1

    Thanks for making this video, For a very long time I was trying to upload a file on Facebook but it was not working, I tried copying many element's XPATH but it was not working, now I got understood the concept. Thanks a lot.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Рік тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @chethankeelaras2458
    @chethankeelaras2458 2 роки тому +1

    Thq So much. Well explained and helped me to understand the concept very easily. Struggled badly by selecting a wrong element to upload the file.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @saurabhganorkar4716
    @saurabhganorkar4716 Рік тому +2

    you are a lifesaver

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Рік тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @paramchaudhary2078
    @paramchaudhary2078 Рік тому +1

    Best Teacher ! Best way to explain with examples👍

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Рік тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @vinayeawarareddy3850
    @vinayeawarareddy3850 Рік тому +1

    Thanks for making this kind of tricky task solution Sir 🤩🤩🤩🤩🤩

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Рік тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @stefangraham7117
    @stefangraham7117 10 місяців тому +1

    Excellent video with a lot of clarity. i followed along and it worked. is it possible to find a work around when you want to upload to chrome images? How exactly to upload a file in selenium using google 'upload a file' with python on windows. the inspection tool doesn't show an input tag or id.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  10 місяців тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  10 місяців тому +1

      Please go through this video for the Windows browse button:
      ua-cam.com/video/ZohudLX9FfY/v-deo.html

    • @stefangraham7117
      @stefangraham7117 10 місяців тому +1

      I have also checked that video. But the Google browser image search I can't find the "ID". Is there a workaround because I know some of these have hidden inputs but again I checked those and it was super confusing to reveal and use. Those also didn't have a "ID" to reference.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  10 місяців тому +1

      @@stefangraham7117 You don't need ID, you need to find the element. It may or may not have an id attribute. If id attribute is not there then you can build XPath.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  10 місяців тому +1

      @@stefangraham7117 Also, you don't need to find hidden element also if you are using browse file way which was discussed in the other video. You can simply click on the browse button and select the file you want as shown in the video.

  • @abc-code6
    @abc-code6 2 роки тому +2

    Hello sir, what a great observation.. I have wasted big time in autoit.. Thank you

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @danthedan20
    @danthedan20 Рік тому +1

    Great information. Thank you, you have been really really helpful

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Рік тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @RHCIPHER
    @RHCIPHER Рік тому +2

    🔥

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Рік тому +1

      Glad you found it helpful :)

    • @RHCIPHER
      @RHCIPHER Рік тому +1

      @@LetsKodeItOfficial i want to upload many file at the same time i did the thing i read all files who are in my folder then i pass them to the send keys but the problem is that some times the file size is big so the small ones it duplicates i put sleep(number) IT FIxed the problem but not optimal because i have no specific sleep do you have a better method

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Рік тому +1

      @@RHCIPHER "Sometimes the file is is big, so it duplicates the small ones"
      I didn't understand the actual problem. Can you please explain again?

    • @RHCIPHER
      @RHCIPHER Рік тому +1

      i fixed it thx any way

  • @rxtechandtrading
    @rxtechandtrading 2 роки тому +1

    you sir are very awesome regarding your tutoring skill..Best teacher and info vid I have ever seen!!! Good work, excellent presentation and use of examples..Why can we not have all teachers present subject matter this way?? Then we would all learn much MUCH faster..

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @xdxd4424
    @xdxd4424 Рік тому +1

    thanks a lot realy apreciate it :)

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Рік тому +1

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.

  • @lipichandran887
    @lipichandran887 2 роки тому +1

    Thank you so much...Very well explained and i the issue i faced had to do with correcting the element.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @saimuraly7688
    @saimuraly7688 3 роки тому +1

    Thank you very much...struggled for days and now relieved that found a way thru you sir....

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Glad you found it helpful, please like and share the video to spread the word :)

  • @RHCIPHER
    @RHCIPHER Рік тому +1

    thx sir

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Рік тому +1

      Glad you found it helpful :)
      Please like and share the video to spread the word and help us.

  • @derekwilliams6558
    @derekwilliams6558 2 роки тому +1

    Outstanding video. Helped me figure out this process. Thanks

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @mikethomas6323
    @mikethomas6323 4 роки тому +4

    Again, as expected an awesome explanation. Thanks!

  • @JOTHISHBABU
    @JOTHISHBABU 3 роки тому +1

    Thanks

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Glad you found it helpful, please like and share the video to spread the word :)

  • @alkdn3507
    @alkdn3507 2 роки тому +1

    Hi, im trying to apply your method In a website but code don't recognise me the XPATH of the imput. Maybe it is because the imput is hidden¿? when I look it on the web code, it has grey color.
    Also, you explained how to search id type [@id=' '], whith class type would be the same? [@class=' ']
    This is the XPATH that i get from copying as u did (but on the website that im trying to do it)
    /html/body/tsl-root/tsl-private/div/div/div/tsl-upload/div/div/tsl-upload-product/form/div[2]/tsl-drop-area/div/div[2]/div/div[1]/label/input
    Thank you for your work, really aprecciate it!

    • @alkdn3507
      @alkdn3507 2 роки тому +1

      Hi, i think I solved my problem.
      Code for imput was hidden by this = _ngcontent-sen-c141, inside the class. So I deleted it and Input is now with colour!, now I need to implement it to my python code using Js, idk how hahaha I will try something.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      @@alkdn3507 Glad you were able to figure it out 😊😊

    • @kameshs4109
      @kameshs4109 2 місяці тому

      hi can you do same activity on naukri page

  • @rubialugattimoreira1978
    @rubialugattimoreira1978 2 роки тому +2

    Perfect!

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful, please like and share the video to spread the word :)

  • @gktomar88
    @gktomar88 4 роки тому +1

    Nice explanation for file upload. thank you

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому +1

      Glad you liked it :)
      Please share the video to spread the word.

  • @vactum0
    @vactum0 Рік тому +1

    unable to find that second video in which you're gonna show uploading file to browser using file explorer too

  • @joscarlenynsosaespana8102
    @joscarlenynsosaespana8102 2 роки тому +2

    Wow great video, but I need another way to upload images, recaude in my case the web code doesn't have an input but it is a tag that contains a class and this class is the one that performs the event of opening the system Windows to select a file from our computer.... Please help In already following you and activated the bell for that video with the solution.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      We can use pynput library for that, I will upload a video on that.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      @Sudha Chauhan Jannabhatla I haven't created that yet. I will try to work on that in future.

  • @sandhyabhattarai425
    @sandhyabhattarai425 3 роки тому +1

    Thankyou so much it works😊

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Glad you found it helpful :)
      Please like and share the video to spread the word.
      You can also look at the description of the video to find the full course information.

  • @nguyenhoangvietk17qn88
    @nguyenhoangvietk17qn88 2 роки тому +1

    Hi sir, This video is very usefull.
    I'm trying to use this way for upload image on facebook post but it doesn't work :(
    Can you help me with it
    Thank you very much

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      What's the issue you are seeing?

  • @hiteshramakanth8201
    @hiteshramakanth8201 3 роки тому +1

    Hello, the explanation was very Crisp. Can you please demo how to it system explorer way

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Sure, I will work on that. Please subscribe and check your notification to make sure you don't miss the video.

  • @wellingtonrodrigues5430
    @wellingtonrodrigues5430 Рік тому +1

    Muito Obrigado. Sou do Brasil e sua dica me ajudou muito.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  Рік тому +1

      Glad you found it helpful :)
      Please like and share the video and help us spread the word.

  • @anilraju93
    @anilraju93 3 роки тому +1

    nice bro

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Glad you liked it :)
      Please share the video to spread the word.

  • @MatheusSilva-qm3ph
    @MatheusSilva-qm3ph 4 роки тому +2

    Great.
    How i use, user-data-dir? Please.

  • @deank9483
    @deank9483 2 роки тому +1

    How to upload two more images at one time? in (Mac) ex)window: desktop\"file1.jpg" "file2.jpg"

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +3

      There is nothing automation do it differently. It is all about what is supported by the website. If the website supports uploading of multiple files at one time then you can send both the file locations one after the other before clicking on upload button.

  • @jc_forex
    @jc_forex 4 роки тому +1

    Hi sir how would you upload multiple files instead of just one file ?

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому +2

      There is nothing different to upload multiple files. If the website supports uploading multiple files, then you can use send_keys() method number of times you want to use.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  4 роки тому +1

      @Kim Hung LEE If the website doesn't support then there is nothing automation can do. Features need to be supported by the application, not by testing.

    • @ammarabbasi4229
      @ammarabbasi4229 3 роки тому

      @Kim Hung LEE did u find out how to upload multiple photos??

  • @kritishah1659
    @kritishah1659 3 роки тому +1

    Sir What’s the difference between the Selenium and SelectorsHub?

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Selenium WebDriver is the actual tool used to automate browsers.
      SelectorsHub is just a browser extension to inspect elements, we don't even need it for automation. We can simply use Chrome Dev Tools.

    • @kritishah1659
      @kritishah1659 3 роки тому +1

      @@LetsKodeItOfficial thanks for the reply sir. I got it and tried it, actually for my project this tool SelectorsHub works while devtools doesn’t work because my project has lots of shadow dom which only SelectorsHub supports

  • @mathc
    @mathc 2 роки тому +1

    and how to send files and not only one file?

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  2 роки тому +1

      It depends on the website functionality. If the website accepts more than one file, we can provide path for multiple files

  • @thakkarharsh6766
    @thakkarharsh6766 3 роки тому +1

    How to do drag and drop code for this 2nd site?

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      We can't drag a file which is on the desktop using Selenium WebDriver as it can only automate browsers. Anything outside of browsers cannot be automated by Selenium WebDriver Automation.

    • @thakkarharsh6766
      @thakkarharsh6766 3 роки тому +1

      @@LetsKodeItOfficial thanks, and 2nd que is how to do send_keys and click method in request library.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      @@thakkarharsh6766 Please explain what exactly you meant by use these methods in request library?

  • @nasinabhargavi8108
    @nasinabhargavi8108 3 роки тому +1

    Hi,
    Could you please demo the other way with out using send keys method.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +2

      Sure, I will work on that. Please subscribe and check your notification to make sure you don't miss the video.

  • @michamyrcha3134
    @michamyrcha3134 3 роки тому +1

    Please add movie how to add file using system dialog window #python + #selenium #linux. Thx :)

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Sure, I will work on that. Please subscribe and check your notification to make sure you don't miss the video.

    • @michamyrcha3134
      @michamyrcha3134 3 роки тому +1

      @@LetsKodeItOfficial of course, but please use example how to do it on Ubuntu system, there is no any tutorial like that. But there are many connected to Windows.

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +2

      @@michamyrcha3134 Most likely I will be using Mac (Unix) or Windows. But it doesn't matter, OS doesn't change any concept of Selenium WebDriver Automation. There is no difference in code other than the path of the file.

  • @hasyaactive2984
    @hasyaactive2984 3 роки тому +1

    HOW TO UPLOAD FILE TO INSTA PROFILE

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      Open Instagram on browser and follow the concept shown in this video.

    • @hasyaactive2984
      @hasyaactive2984 3 роки тому +1

      @@LetsKodeItOfficial but there is no input tag

    • @LetsKodeItOfficial
      @LetsKodeItOfficial  3 роки тому +1

      @@hasyaactive2984 In that scenario, you need to use pynput library to browse the files from the computer. I will be posting a video about this also in future.