Skip to content

Instantly share code, notes, and snippets.

from grab import Grab
g = Grab()
g.go('https://www.python.org/')
for i in g.doc.select('//*[@id="content"]/div/section/div[2]/div[2]/div/ul/li'):
print(i.text())
import json
from django.db import models
class Product(models.Model):
categories = models.ManyToManyField(Category,
related_name='products',
blank=True, verbose_name=u"категории")
related_products = models.ManyToManyField('Product',
blank=True,