擅长:python、mysql、java
<p>如果您有使用Python的经验,您应该使用beauthoulsoup库和lxml解析器来解析xml。它可以让你很容易和直观地浏览标签。
<a href="http://www2.hawaii.edu/~takebaya/cent110/xml_parse/xml_parse.html" rel="nofollow noreferrer">http://www2.hawaii.edu/~takebaya/cent110/xml_parse/xml_parse.html</a></p>
<p>为了处理大数据量,您可以将每个页面分隔成不同的文件,并使用glob将它们加载到Python中,一次解析一个文件。
<a href="https://stackoverflow.com/questions/3964681/find-all-files-in-a-directory-with-extension-txt-in-python">Find all files in a directory with extension .txt in Python</a></p>
<p>对于最终的数据结构,mongodb听起来不错。如果要进行全文搜索,请记住构建文本索引。
<a href="https://docs.mongodb.com/manual/core/index-text/" rel="nofollow noreferrer">https://docs.mongodb.com/manual/core/index-text/</a></p>