V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  ciba1990  ›  全部回复第 2 页 / 共 2 页
回复总数  30
1  2  
2015-07-10 14:09:55 +08:00
回复了 ciba1990 创建的主题 Python python 怎么获取网页 submit 传输字符串
@zeroten
请问怎么实现?我是从html里面通过submit将keyword传送到模板文件views.py中的一个keywords变量。
2015-07-10 10:25:00 +08:00
回复了 ciba1990 创建的主题 Python 抓取的代码放到<body>里<变成&lt;
@loading
有16楼的方法解决了
2015-07-10 01:31:37 +08:00
回复了 ciba1990 创建的主题 Python 抓取的代码放到<body>里<变成&lt;
@lcqtdwj 美元已发,请查收!
2015-07-10 01:19:13 +08:00
回复了 ciba1990 创建的主题 Python 抓取的代码放到<body>里<变成&lt;
@icedx 怎么解决
2015-07-10 01:15:32 +08:00
回复了 ciba1990 创建的主题 Python 抓取的代码放到<body>里<变成&lt;
@imlonghao
用的django
views.py
def index(request):
template = loader.get_template('python.html')
context = Context({'keyword':mydiv})
return HttpResponse(template.render(context))

python.html
<html>
<head>
</head>
<body>{{keyword}}</body>
</html>
2015-07-10 01:08:06 +08:00
回复了 ciba1990 创建的主题 Python 抓取的代码放到<body>里<变成&lt;
@imlonghao
html=urllib2.urlopen(url).read()
soup = BeautifulSoup(html)

link = soup.find_all('div')

mydiv=str(link[0])
2015-07-10 01:07:33 +08:00
回复了 ciba1990 创建的主题 Python 抓取的代码放到<body>里<变成&lt;
@wkdhf233 正则怎么用,
html=urllib2.urlopen(url).read()
soup = BeautifulSoup(html)

link = soup.find_all('div')

mydiv=str(link[0])
这是我爬虫代码,新手上路。
2015-07-10 00:57:33 +08:00
回复了 ciba1990 创建的主题 Python 抓取的代码放到<body>里<变成&lt;
@imlonghao


<html>
<head>
</head>
<body>

&lt;div class=&quot;searchResults&quot; id=&quot;searchResults&quot;&gt;
&lt;h2&gt;Web results&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;h3&gt;&lt;a href=&quot;https://www.python.org/&quot; target=&quot;_blank&quot;&gt;Welcome to Python.org&lt;/a&gt;&lt;/h3&gt;
&lt;p class=&quot;url&quot;&gt;https://www.python.org/&lt;span class=&quot;date&quot;&gt; - 7 hours ago&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The official home of the Python Programming Language.&lt;/p&gt;
&lt;/li&gt;&lt;li class=&quot;sameHostResult&quot;&gt;
&lt;h3&gt;&lt;a href=&quot;https://www.python.org/downloads/&quot; target=&quot;_blank&quot;&gt;Download Python | Python.org&lt;/a&gt;&lt;/h3&gt;
&lt;p class=&quot;url&quot;&gt;https://www.python.org/downloads/&lt;/p&gt;
&lt;p&gt;... 2015-05-23 Download Release Notes &lt;br&gt;
· Python 3.4.3 2015-02-25 Download ...&lt;/br&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;h3&gt;&lt;a href=&quot;http://www.pyhton.org/&quot; target=&quot;_blank&quot;&gt;Wrong Page ?&lt;/a&gt;&lt;/h3&gt;
&lt;p class=&quot;url&quot;&gt;http://www.pyhton.org/&lt;/p&gt;
&lt;p&gt;If you were trying to reach Phyton website please copy and past the following &lt;br&gt;
URL in your browser: http://www.phyton.org. YOU MAY HAVE GOTTEN HERE BY&lt;br&gt;
...&lt;/br&gt;&lt;/br&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;h3&gt;&lt;a href=&quot;http://www.salome-platform.org/forum/forum_10/211874468&quot; target=&quot;_blank&quot;&gt;Creating geometry using &lt;b&gt;pyhton&lt;/b&gt; code — SALOME Platform&lt;/a&gt;&lt;/h3&gt;
&lt;p class=&quot;url&quot;&gt;http://www.salome-platform.org/forum/forum_10/211874468&lt;/p&gt;
&lt;p&gt;Hello everyone!,. I&#39;m almost new in salome; I build up a simple geometry (n &lt;br&gt;
nodes and n-1 beams) using the salome gui. It took me a long time; then I &lt;br&gt;
discovered ...&lt;/br&gt;&lt;/br&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;h3&gt;&lt;a href=&quot;http://developers.gigya.com/display/GD/Pyhton+SDK+Change+Log&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Pyhton&lt;/b&gt; SDK Change Log - Gigya Documentation - Developers Guide&lt;/a&gt;&lt;/h3&gt;
&lt;p class=&quot;url&quot;&gt;http://developers.gigya.com/display/GD/Pyhton+SDK+Change+Log&lt;/p&gt;
&lt;p&gt;Jun 10, 2015 &lt;b&gt;...&lt;/b&gt; Version 2.17 - 26 Apr 2015. Bug fix regarding URL encoding. The Python SDK &lt;br&gt;
now restores urllib handlers after completing requests to Gigya.&lt;/br&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;h3&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=4Ubn8vPpCz0&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Pyhton&lt;/b&gt; - You A Me LifeIine Full Promo Dancehall 2015 - YouTube&lt;/a&gt;&lt;/h3&gt;
&lt;p class=&quot;url&quot;&gt;http://www.youtube.com/watch?v=4Ubn8vPpCz0&lt;/p&gt;
&lt;p&gt;Feb 16, 2015 &lt;b&gt;...&lt;/b&gt; &lt;b&gt;Pyhton&lt;/b&gt; - You A Me LifeIine ○Full Promo○ Dancehall 2015. IamDjChigga ... Up &lt;br&gt;
Hot DJ Chigga &lt;b&gt;Pyhton&lt;/b&gt; A Good Artists the Thing Loud...$$$$$.&lt;/br&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li class=&quot;sameHostResult&quot;&gt;
&lt;h3&gt;&lt;a href=&quot;http://www.youtube.com/watch?v=VLTZc-MX5DI&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Pyhton&lt;/b&gt; - Mommy Nah Worry No More Full Promo Dancehall 2015 &lt;b&gt;...&lt;/b&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p class=&quot;url&quot;&gt;http://www.youtube.com/watch?v=VLTZc-MX5DI&lt;/p&gt;
&lt;p&gt;Mar 20, 2015 &lt;b&gt;...&lt;/b&gt; &lt;b&gt;Pyhton&lt;/b&gt; - Mommy Nah Worry No More ○Full Promo○ Dancehall 2015. &lt;br&gt;
IamDjChigga. SubscribeSubscribedUnsubscribe ...&lt;/br&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;h3&gt;&lt;a href=&quot;https://www.thenewboston.com/forum/topic.php?id=6569&quot; target=&quot;_blank&quot;&gt;&lt;b&gt;Pyhton&lt;/b&gt; GUI´s - thenewboston Forum&lt;/a&gt;&lt;/h3&gt;
&lt;p class=&quot;url&quot;&gt;https://www.thenewboston.com/forum/topic.php?id=6569&lt;/p&gt;
&lt;p&gt;May 2, 2015 &lt;b&gt;...&lt;/b&gt; Can anyone recommend a good book( i.e. as in paper) to use as a reference &lt;br&gt;
work with Python GUis. There are lots of excellent videos etc on ...&lt;/br&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;h3&gt;&lt;a href=&quot;http://www.gamefaqs.com/psp/932978-metal-gear-solid-portable-ops/answers/189967-how-do-i-beat-pyhton&quot; target=&quot;_blank&quot;&gt;How do I beat &lt;b&gt;pyhton&lt;/b&gt;? - Metal Gear Solid: Portable Ops Answers for &lt;b&gt;...&lt;/b&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p class=&quot;url&quot; title=&quot;http://www.gamefaqs.com/psp/932978-metal-gear-solid-portable-ops/answers/189967-how-do-i-beat-pyhton&quot;&gt;http://www.gamefaqs.com/psp/932978-metal-gear-solid-portable-ops/answe...&lt;/p&gt;
&lt;p&gt;For Metal Gear Solid: Portable Ops on the PSP, a GameFAQs Answers question &lt;br&gt;
titled &quot;How do I beat &lt;b&gt;pyhton&lt;/b&gt;?&quot;.&lt;/br&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;h3&gt;&lt;a href=&quot;https://bugs.launchpad.net/bugs/1415067&quot; target=&quot;_blank&quot;&gt;Bug #1415067 “QtiPlot crashed when chossing &lt;b&gt;Pyhton&lt;/b&gt; as default sc &lt;b&gt;...&lt;/b&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p class=&quot;url&quot;&gt;https://bugs.launchpad.net/bugs/1415067&lt;/p&gt;
&lt;p&gt;Jan 27, 2015 &lt;b&gt;...&lt;/b&gt; I installed qtiplot and worked on it for a while. Changing the Default scripting &lt;br&gt;
language to &lt;b&gt;Pyhton&lt;/b&gt; in Preferences, I end with this problem.&lt;/br&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;

</body>
</html>
2015-07-10 00:55:18 +08:00
回复了 ciba1990 创建的主题 Python 抓取的代码放到<body>里<变成&lt;
@wkdhf233 就是我在a站抓取了一段<div>代码放到自己网页,<>在我网页源代码现实成&lt,而且不能正常显示网页。
2015-07-10 00:51:43 +08:00
回复了 ciba1990 创建的主题 Python 抓取的代码放到<body>里<变成&lt;
新手求教。。。。。在线等ing
1  2  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2026 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 12ms · UTC 16:19 · PVG 00:19 · LAX 09:19 · JFK 12:19
Developed with CodeLauncher
♥ Do have faith in what you're doing.