【发布时间】:2017-05-12 03:14:23
【问题描述】:
我有一些 Dot Net 代码可以解析和检索 URL 字符串中的值。
但是,我想执行相同的功能,但现在改用 python 代码。
点网代码sn-p如下:
string queryString = string.Empty;
string application_id = string.Empty;
string currentURL = Browser.getDriver.Url;
Uri url = new Uri(currentURL);
string query_String = url.Query;
application_id = query_String.Split(new char[] { '=' }).Last();
提前致谢
【问题讨论】:
-
我们需要更多信息,您是否会在网络框架内以
Django或Flask运行您的代码?因为你的代码的最后一行在 Python 上几乎相同,所以我假设你想要 python 中的整个功能:从检索 URL 到去除它的 id。