从im入门到Django框架和python语言。我需要帮助。我需要从html按钮中运行外部python脚本,也可以从html获得值,并将输出显示回网页。
工作流程示例:
Input text : "hello", click "submit" on html button.
Run world.py : receive "hello" as variable. Add "world"
Post it back to the same html page and shows "helloworld" .
我正在尝试用python抓取一个非常简单的网页。
我在抓取上找到的大多数方向都指导您查看源代码以确定结构,然后使用“元素”来访问所需的信息。然而,我正在处理的网页格式很差,并且没有在线示例中描述的元素类型。
我的网页是这样的:
<html>
<head></head>
<body>
"Title 1, Title 2, Title 3"
<br>
"Info 1, Info 2, Info 3"
<br>
"Info 1, Info 2
string BODY = String.Empty;
string PageName = @"[C:\Users\User1\Desktop\SK\Resources\HTMLEmail\email.html]";
BODY = new StreamReader(PageName).ReadToEnd();
我正在使用上面的代码读取我的C#代码中的HTml文件,我想做的是添加一些文本到文件中并保存它,或者我必须将文件发送到与文件一起发送电子邮件的方法。
下面的代码是从email.html我必须添加电子邮件地址和密码