I want to pass the variable from php to python and i use this code for that:
php
<?php
$item='http://www.google.com';
$tmp = passthru("python test.py ".$item);
python
from selenium import webdriver
import sys
link = sys.argv[1]
chrome_path = r"C:\Users\user\Downloads\chromedriver_win32\chromedriver.exe"
driver = webdriver.Chrome(chrome_path)
driver.get(link)
s = driver.page_source
and this works fine, but now in this process, I want to pass this variable s from python in the PHP, can I do it somehow in one step, when I pass the variable from PHP to python to receive the result of python code again in the PHP
shell_exec, usingshell_execrun your python script which returns ajson, this will get stored in yourshell_execvar. Won't this work?