I build a Webscraper in python, which generates the right output when executed. Now I wanted to implement it to a C# project and it doesn´t work. I just don´t get any ouput from it. I tried finding a problem with printin things to labels in different steps but it seems to work fine. My python code:
import bs4
import requests
from bs4 import BeautifulSoup
r = requests.get("https://fred.stlouisfed.org/series/AAA")
soup = bs4.BeautifulSoup(r.text,"lxml")
soup_find = soup.find_all("div",{"class":"pull-left meta-col"})[0].find("span",{"class":"series-meta-observation-value"}).text
print(soup_find)
And my C# Code (in Visual Studio):
private void cmd_scrape_Click(object sender, EventArgs e)
{
string fileName = @"My\path\to\Webscraper.py";
Process p = new Process();
p.StartInfo = new ProcessStartInfo(@"My\path\to\python.exe", fileName)
{
RedirectStandardOutput = true,
UseShellExecute = false,
CreateNoWindow = true
};
p.Start();
lbl_Out.Text = "Starting...";
string Output = p.StandardOutput.ReadToEnd();
lbl_Out.Text = "Waiting for exit...";
p.WaitForExit();
lbl_Out.Text = "Done";
lbl_Out.Text = Output;
}


\r\nto python's output at the end of data.