小编Pet*_*sen的帖子

没有更多BeautifulSoup

我一直在使用BeautifulSoup,但据我所知,库不再被维护.那我该怎么用?我听说过Xpath,但还有什么?

python parsing

3
推荐指数
2
解决办法
621
查看次数

列表上的Python正则表达式

我正在尝试构建一个解析器并将结果保存为xml文件,但我有问题..

请问各位高手请看看我的代码?

追溯 :TypeError: expected string or buffer

import urllib2, re
from xml.dom.minidom import Document
from BeautifulSoup import BeautifulSoup as bs
osc = open('OSCTEST.html','r')
oscread = osc.read()
soup=bs(oscread)
doc = Document()
root = doc.createElement('root')
doc.appendChild(root)
countries = doc.createElement('countries')
root.appendChild(countries)
findtags1 = re.compile ('<h1 class="title metadata_title content_perceived_text(.*?)`</h1>', re.DOTALL |  re.IGNORECASE).findall(soup)
findtags2 = re.compile ('<span class="content_text">(.*?)</span>', re.DOTALL |  re.IGNORECASE).findall(soup)
for header in findtags1:
title_elem = doc.createElement('title')
countries.appendChild(title_elem)
header_elem = doc.createTextNode(header)
title_elem.appendChild(header_elem)
 for item in findtags2:
    art_elem = doc.createElement('artikel')
    countries.appendChild(art_elem)
    s = …
Run Code Online (Sandbox Code Playgroud)

python xml parsing

2
推荐指数
1
解决办法
1063
查看次数

Python:Dennis Nedry - 安全

有没有人见过Jurrassic Park,Dennis Nedry用一个动画片来保护系统,这个动画在系统发生故障后说"你没有说出神奇的词".

是否有可能做类似ikn Python的事情?

用它来形容它不那么幽默:

响应屏幕,等待用户满足的条件.并在一段时间后加密并锁定系统.

这可能是在Linux系统上使用Python吗?

python code-access-security

1
推荐指数
1
解决办法
441
查看次数

标签 统计

python ×3

parsing ×2

code-access-security ×1

xml ×1