Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_SERVER['REQUEST_METHOD'] === 'POST')
- {
- $keyword = $_POST['singleSearchTerm'];
- $filename = $_POST['singleFilename'];
- $settings = file('settings.txt', FILE_SKIP_EMPTY_LINES);
- $conda_path = $settings[0];
- $working_env = $settings[1];
- $script = "scrape.py";
- $url = "https://www.pinterest.com/search/pins/?q=";
- $current_dir = getcwd();
- // cd into path
- $cd_path = "cd " . $conda_path . "&& ";
- // activate env
- $activate_env = "activate " . $working_env . " && cd ";
- // run python script
- $pyCommand = $current_dir . "\ps\ " . " && python -W ignore ". $script . " --url " . $url . $keyword . " --fname " . $filename;
- // full command
- $full_command = $cd_path . $activate_env . $pyCommand;
- echo $full_command;
- // test - works fine
- exec("start notepad.exe");
- // doesn't do anything
- exec($full_command);
- // doesnt do anything
- system($full_command)
- }
- cd C:Usersda74Anaconda3Scripts && activate scrape && cd C:MAMPhtdocspinscraperps && python -W ignore scrape.py --url https://www.pinterest.com/search/pins/?q=old --fname dat.csv
- exec("start notepad.exe");
Add Comment
Please, Sign In to add comment