Python Automation | Part 10 : Automatic Form Submission using Python |Python Selenium Web Automation

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ย. 2020
  • In this Python Automation video, we are gonna be automating Form Submission such that we can submit data from an excel file or csv file or similar, regardless of the quantity, whether it be 1000, 10k or 100k. The idea is fetching data, processing data, and submit each of them into the form. We will go through three important things in this video :
    1) Read/Fetch data from an excel/csv/simlar file using Pandas, the popular and loved package by Data Scientists.
    2) Handling inputs such as radio input, checkbox input and select elements using Selenium.
    3) Executing JavaScript in Selenium.
    We will leverage Python Selenium for this Automatic Form Submission in Python Automation.
    Join Code Band Community❤️
    WhatsApp Group Link:
    lnkd.in/gJ-rrrz
    Telegram Group Link:
    t.me/codebandcommunity
    Full Playlist : Python Web Automation | Python Selenium Tutorial | Python Automation Tutorial : • Python Web Automation ...
    Project Files - Github Repository : github.com/akjasim/python-aut... (In branch 7-automatic-form-submission)
    Don't forget to give a ⭐️ to the repo.
    References :
    Selenium Select Docs : selenium-python.readthedocs.i...
    Selenium Docs : selenium-python.readthedocs.io/
    Subscribe | Code Band
    Other videos in Code Band:
    WhatsApp Automation using Python Selenium : • Video
    Python Automation | Part 5 :Instagram Profile Fetch Automation|Python Web Automation|Python Selenium : • Python Automation | Pa...
    Python Automation|Part 6 : Gmail Bulk Email Sending Automation|Python Web Automation|Python Selenium : • Python Automation|Part...
    Build a Weather App in Django | Scrape Weather Data from Google | Beautiful Soup | Python Requests : • Build a Weather App in...
    Python Interview Questions | Python Tricks | Python Tricky Programs | Python Tricks and Hacks : • Python Interview Quest...
    Python .env File | Django .env File Example | Python Decouple Django | Django Environment Variables : • Python .env File | Dj...
    Django Autocomplete with jQuery UI | AJAX | Search | Filter from Database | Tutorial | Code Band : • Django Autocomplete wi...
    Django Dependent Drop Down List Example | Integration with Django Forms and Django Form Validations : • Django Dependent Drop ...
    Django Select2 Tutorial | Django Dropdown | Django ajax Dropdown | Django Search and Filter : • Django Select2 Tutoria...
    Django Shell Plus | Advanced Django Shell | Django Shell Commands | Django Shell Tutorial : • Django Shell Plus | Ad...
    Django Seed Data into Database Models | Django Faker | Django loaddata | Django Dummy Data : • Django Seed Data into ...
    3 Cool Django Features that Django Developers are Not Aware of : • 3 Cool Django Features...
    Django Custom User Model | Email as Username | Phone as Username | Authentication Example |Code Band : • Django Custom User Mod...
    Playlist | Django Authentication | The easiest and actual way of doing it : • Django Authentication ...
    Playlist | Django Relationships | Explained with Example by Code Band : • Django Relationships |...
    Custom Model Manager & Model QuerySet in Django : • Custom Model Manager &...
    Render Django Form Manually : Make Custom Form with Form Validations - • Render Django Form Man...
    Generic Class Based Views in Django | Introduction & Create View in Django | Learn by Example | CRUD : • Generic Class Based Vi...
    How to Deploy Django Project on Heroku for Free : • How to Deploy Django P...
    Connect Django with MySQL : • How to Connect Django ...
    Instagram Automation using Python : • Instagram Automation u...
    Top 5 Programming Languages to Learn in 2020 : • Top 5 Programming Lang...
    :) You Can Find Me On:
    My Website - jasim.tech/
    Linkedin - / akjasim
    Github - github.com/akjasim/
    Facebook - / jasimakjasim
    Twitter - / akjasim
    Instagram - / jasim_ak

ความคิดเห็น • 68

  • @adithyanvr9399
    @adithyanvr9399 3 ปีที่แล้ว +3

    1 st
    Please pin me

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      Keep supporting brother❤️

  • @ajmalbinnizam
    @ajmalbinnizam 3 ปีที่แล้ว +1

    keep going bro..
    addicted to the web automation playlist 😍😍

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      Lots of love bro❤️ Keep going👍🏻👍🏻

  • @sidtech10
    @sidtech10 2 ปีที่แล้ว +1

    Thank you so much ❤
    that 2nd way to submit was really helpful for me

    • @CodeBand
      @CodeBand  2 ปีที่แล้ว +1

      Very glad to hear that😊

  • @TevfikBagcivan
    @TevfikBagcivan 3 ปีที่แล้ว +1

    This video is very helpful for web automation. Thank you

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +2

      Glad it was helpful!😊

  • @tigreonice2339
    @tigreonice2339 7 หลายเดือนก่อน +1

    Related with selenium: I have an excel or csv file, some cells have NaN value. I want when there's no value (Nan) the driver doesn't fill in the web input(with 'Nan' or nan), just skip it to the next line code instruction.... how can I do that?

  • @rangabharath4253
    @rangabharath4253 3 ปีที่แล้ว +1

    awesome as always bro

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      Thanks a lot brother..keep supporting❤️

  • @mfsdrawings8600
    @mfsdrawings8600 3 ปีที่แล้ว +1

    Superb🤩👍

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      Thanks a lot❤️

  • @rahulteja536
    @rahulteja536 3 ปีที่แล้ว +2

    really helped me a lot.

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +2

      Very glad to hear that and keep going😊

  • @madhav3444
    @madhav3444 3 ปีที่แล้ว +1

    Hey just wanna thank you for this precious knowledge. I have a question, that what if the script brokes somehow in between for any particular row data of excel, how can we tackle this thing and continue our script for other row data or index?

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      Good question, you can achieve this thing in different ways....
      1) By having a file in which you have the current row number...You need to update this value after you complete each item...
      2) Keeping a separate copy of the excel file, and upon filling the data, delete that specific row...
      And a lot of other ways too...
      Keep going👍🏻

  • @davidramosmartinez9057
    @davidramosmartinez9057 2 ปีที่แล้ว +1

    Hi there,
    Thanks for share your knowledge, I'm having an issue entering numbers from an excel.
    Python is giving me this error "object of type 'numpy.int64' has no len() ", I google it and it telling me that is error happend when you try to add types such as integer, float, boolean, long, complex.
    What other fuction can I use in this case?
    Kind regards!

    • @CodeBand
      @CodeBand  2 ปีที่แล้ว +1

      Sorry for the late reply...
      Is this solved ? Or can you pin-point where exactly the error is occurring...

  • @harriscastro535
    @harriscastro535 3 ปีที่แล้ว +1

    This a great video. It seems that the xpath for choosing radio button is not working when used in MS Forms. I tried it and it just skips the radio button question for me. Do you have any alternative way to choose a radio button based on MS Forms? Thanks!

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      Glad to hear that... I haven't actually tested with MS Forms... Please research on Google and SO, and if you've found any solution, please post here.
      Thanks🙌🏻

  • @sanielsainoding2735
    @sanielsainoding2735 ปีที่แล้ว

    Subs here, may I ask if I run again the script it will run same entry.? I just wanted to skip the entry once it is done. Please help

  • @RaviSharma-zb9ve
    @RaviSharma-zb9ve 3 ปีที่แล้ว +1

    thanks a lot

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      Glad to help you out...😊

  • @ThamizhiShanmugam
    @ThamizhiShanmugam 2 หลายเดือนก่อน

    Hi, does this work for Microsoft Forms?

  • @creshalybeau149
    @creshalybeau149 2 ปีที่แล้ว +1

    Hello do you have any idea how to automatic web form with datepicker? I have excel file with date(dd-mm-yyyy) and rainfall coloumn for a month. How can i autofill them with a form consist of date picker and rainfall entry. Thank you

    • @CodeBand
      @CodeBand  2 ปีที่แล้ว +1

      Sorry for the late reply...
      Was this solved ?
      It's actually not very hard, check this out :
      stackoverflow.com/questions/49747034/select-from-a-datepicker-in-python

  • @madhav3444
    @madhav3444 3 ปีที่แล้ว +1

    Have you ever explained in any of your video that how can we scrap the values from the Web and fills back the values in excel for a particular row, then plss refer your tutorial or make a tutorial, it would be really helpful. Thank you ❤️❤️

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +2

      Great suggestion! I actually planned for one...but somehow, I just forgot that stuff...I will post one in future, if possible. Anyway, I have explained scraping in my earlier videos (Instagram Profile Fetching), the only thing I left behind was writing into excel which you can btw do with pandas library or the normal Python DictWriter class. (I have also explained how to read data from excel and fill in the form in this video.)
      Keep going😊

    • @mpumisetshedii
      @mpumisetshedii ปีที่แล้ว

      Have you found a resource for this?

  • @awaismaz
    @awaismaz ปีที่แล้ว +1

    How to deal with 'unseen' forms. If I have a url and I need to find forms on that url and submit them automatically without opening them and finding xpath, what will be the procedure?

    • @CodeBand
      @CodeBand  ปีที่แล้ว +1

      Sorry for the late reply...
      Were you able to design that ?
      Well, that's achievable, but a little tricky. You'll have to find forms by tag, get all the inner inputs, read the input field name and populate the data and then submit.

  • @royalwinautomatedsoftware2985
    @royalwinautomatedsoftware2985 2 ปีที่แล้ว +1

    Hai sir, ur video super. I learn so much ur channel. I have one this video I try read data is work. I want write data for excel can plz send format for write data in pandas

    • @CodeBand
      @CodeBand  2 ปีที่แล้ว +1

      Sorry for the late reply...
      This can be a good resource : xlsxwriter.readthedocs.io/working_with_data.html

  • @mehulpanchal4472
    @mehulpanchal4472 2 ปีที่แล้ว +1

    Hi Code Band,
    Need your help to find Combo Box and entering the value .Can you please help me on this

    • @CodeBand
      @CodeBand  2 ปีที่แล้ว +1

      Sorry for the late reply...
      Solved ?

  • @akm1511
    @akm1511 3 ปีที่แล้ว +1

    Hey
    Can you please help me on how to fire a website using single sign on.. because as soon as the website detects that chrome is being controlled by automation test software it does not allow access.

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      Which service are you using? Sign In with Google?

    • @akm1511
      @akm1511 3 ปีที่แล้ว +1

      @@CodeBand Never mind.. I figured it out. But yes kudos to you. Nice tutorial with all bases covered.

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +2

      @@akm1511 Very glad to hear that...keep going👍🏻

  • @stembabe740
    @stembabe740 3 ปีที่แล้ว +1

    How can we edit the script to run so that it automatically fills out the patient information only after inputting the the first form.

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      You can put an input() before the actual code for auto filling begins and then after filling the first form, you can enter something in the console, and the rest of the code works...
      This is just one way of doing it😊

    • @stembabe740
      @stembabe740 3 ปีที่แล้ว +1

      @@CodeBand in this case it would be input patientID and then the rest of the form would be completed

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      You can do pretty much everything as you're doing it manually...after typing anything in the console, the rest of the code executes...😊

  • @royalwinautomatedsoftware2985
    @royalwinautomatedsoftware2985 2 ปีที่แล้ว +1

    Hai sir, ur video super. I learn so much ur channel. I have one doubt I'm using excel data python. Excel sheet cells I have created formula. Excel read data python program only copy formula not value. Please help me I need excel rows read values only. Please advise sir.

  • @omkarupare8706
    @omkarupare8706 2 ปีที่แล้ว +1

    I want to reload form after first entry submitted and after that fill second entry .

    • @CodeBand
      @CodeBand  2 ปีที่แล้ว +2

      If it's not going somewhere(or reloading), you can manually refresh the page like how you first navigated to the same page initially.
      Alternatively, you can use,
      driver.refresh()

  • @moeinht2713
    @moeinht2713 2 ปีที่แล้ว +1

    I used selenium to click a page
    I need to use Chrome cache and cookies
    But Chrome works as a test software
    please guide me

    • @CodeBand
      @CodeBand  2 ปีที่แล้ว +1

      Sorry for the late reply...
      Check this out : stackoverflow.com/questions/53095611/python-selenium-how-to-get-cookies-and-format-them-to-use-in-an-http-request

  • @hamud350
    @hamud350 3 ปีที่แล้ว +1

    or i in range(len(val)):
    TypeError: object of type 'numpy.int64' has no len() how to fix this

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      Please tell me where the error is, I mean the timestamps, so that I can help you out...
      Probably, the issue here is you might have incorrectly placed the variable 'val' in the for loop😊

    • @vmdbeats5909
      @vmdbeats5909 3 ปีที่แล้ว +1

      @@CodeBand i have this issue too and I dont have a val variable in my code at all nor the '' len() function

    • @vmdbeats5909
      @vmdbeats5909 3 ปีที่แล้ว +1

      you can do for exp : title.send_keys(str('' the input''))
      converting it to a string fixed it for me

    • @aryajakbar5830
      @aryajakbar5830 3 ปีที่แล้ว

      @@vmdbeats5909 it works but the code input all data in the column.
      can you help me?

  • @hamud350
    @hamud350 3 ปีที่แล้ว +1

    Hey bro when it’s a number it doesn’t type it any idea how to fix it

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      You might need to convert it into str...
      something like str(your_field)

  • @amarnath9945
    @amarnath9945 3 ปีที่แล้ว +1

    3:58-4:05 You said that it has been already discussed it's simple. please share the link of the discussion, I need that

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      This video is a part of Python Automation Series... I have taught all those things in the previous videos...

  • @wspaiva
    @wspaiva 3 ปีที่แล้ว +1

    Thank you very much!!!
    Congrats!!! Like DONE - Subscribe Super DONE

    • @CodeBand
      @CodeBand  3 ปีที่แล้ว +1

      Very glad to hear that...😊

  • @vatsalaykhobragade
    @vatsalaykhobragade 2 ปีที่แล้ว +1

    My code is filling the form for the first time only after that the program just stops. How do I fix this ?

    • @CodeBand
      @CodeBand  2 ปีที่แล้ว +1

      Sounds like some issues with the code you've written... Maybe the loop is only running once... Please check and confirm...

    • @vatsalaykhobragade
      @vatsalaykhobragade 2 ปีที่แล้ว +1

      @@CodeBand I've fixed it.

    • @CodeBand
      @CodeBand  2 ปีที่แล้ว +2

      @@vatsalaykhobragade Keep going

  • @srinivasanseenu731
    @srinivasanseenu731 ปีที่แล้ว +1

    I am getting this error "name 'send_keys' is not defined " .
    I tried both the package, but still same issue
    from selenium.webdriver.common.keys import Keys
    Import selenium.webdriver.common.keys.

    • @CodeBand
      @CodeBand  ปีที่แล้ว +1

      Sorry for the late reply...
      Was this fixed ? Seems like the object you're trying to send_keys to is not an input field.