擅长:python、mysql、java
<p>将此添加到<code>scrapper.py</code>:</p>
<pre class="lang-py prettyprint-override"><code>import path.to.model
product = Product()
product.<key> = <value> #Where key is the field and value is the value you need to fill
</code></pre>
<p>在指定每个字段之后,添加
<code>product.save()</code></p>
<p><strong技巧</p>
<p>如果json响应中的所有键都与模型中的字段匹配,则可以执行以下操作:</p>
^{pr2}$
<p>这将为您节省大量的线路和时间:)</p>