I have an excel file with 3 columns, "First name", "Last name", "email" and about 700 entries (rows). I also have a website with a form for first name, last name and email. Obviously I don't want to type out all 700 entries manually. Is there a way to get these columns from excel and enter them into the online form? Perhaps using visual basic/php or any other alternative. If such code already exists then it would be great if somebody could show me. If not, then it would be appreciated if somebody could give some advice on how to approach this. Thanks!
-
1Possible duplicate of [How to import CSV file to MySQL table](https://stackoverflow.com/questions/3635166/how-to-import-csv-file-to-mysql-table) – sumit Jun 26 '17 at 04:36
2 Answers
Its easier to do this in python/java. Excel is just used to store the list of input values but to actually input it into a webpage using an automated technique you will need to read about webscraping.
Things like BeautifulSoup (a package in python) and Selenium (a java package) can be used for this purpose. You will have to read about them and maybe ask questions to people who know python/java not excel/vba experts.
Here is one link that can get you started How can I input data into a webpage to scrape the resulting output using Python?
Edit: I found one link which could help in doing it through VBA but you need to tell us which website only then can someone help you further Input text into html input box using vba

- 1,393
- 1
- 12
- 28
-
Hi Raunak, thanks for your answer. The website is actually LinkedIn's lead builder in sales navigation. I just used a basic example of first name, last name and email to explain my question. – Programmer Jun 26 '17 at 05:08
PHP has a CSV method, you can convert/save your excel file to csv and process if using PHP.
Reading the File in PHP
Example 1
How to create an array from a CSV file using PHP and the fgetcsv function
$file = fopen('youruploadedfile.csv', 'r');
while (($line = fgetcsv($file)) !== FALSE) {
// each line of the array
print_r($line);
}
fclose($file);
Example 2
https://www.w3schools.com/php/func_filesystem_fgetcsv.asp
$file = fopen("youruploadedfile.csv","r");
while(! feof($file))
{
print_r(fgetcsv($file));
}
fclose($file);
check out https://www.w3schools.com/php/func_filesystem_fgetcsv.asp
Definition and Usage
The fgetcsv() function parses a line from an open file, checking for CSV fields.
The fgetcsv() function stops returning on a new line, at the specified length, or at EOF, whichever comes first.
This function returns the CSV fields in an array on success, or FALSE on failure and EOF.
Selenium
Selenium is a tool to automate user interface testing. It helps with testing your application against the browser
Take a look at the web driver https://github.com/facebook/php-webdriver
There is also varied information on how to's on SO. How to use Selenium with PHP?

- 1,725
- 2
- 14
- 26