Web Automation: Using Data From a CSV

preview_player
Показать описание
Web Automation: Using Data From a CSV
In this quick tutorial, I go over a concept of using CSV imports in web automation. This was a real world example, where a friend of mine managed a parts store. The inventory software they used wasn't very robust. It was a web form that only let them submit meta data or tags on each part - one part at a time. The software had no CSV import and the company behind the software didn't have any services to import large data sets.

In the case of my friend, he had over 4,000 parts that needed to be updated in inventory. He asked if I could help.

My solution was to use the only thing we had access to: the web form itself. Using Watir-Webdriver and the CSV library, I used Watir to mitigate the web site (logging in and getting to the inventory search form), I iterate over the CSV file and take the part number from each row and plug it into the form, search for the part and then do the tagging he required. Once done, I submit the changes. This loops through the entire CSV file.

The 4,000 entries took over 8 hours to complete, but it was better than having a human being do it. We just would run this in a background job on a VM. That way it didn't disrupt any work, computer time, or human time.
Рекомендации по теме
join shbcf.ru