Home python PARSING WITH GRAB on Python

PARSING WITH GRAB on Python

Author

Date

Category

I take an example from the documentation (http://docs.grablib.org /ru/LateSt/Grab/Text_Search.html#id2 ) and just copy it. He does not work. Error

is issued

/ library / frameworks / python.framework / versions / 3.5 / lib / python3.5 / site-packages / grab / autil/warning.py:28: GrabDeprecationWarning: Call to Deplecated Function Search. Use grab.doc.text_search instead.
WARN (Message)

All code:

from grab import grab
G = grab ()
url = 'https://news.yandex.ru/index.rss'
G.go (URL)
G.Search (U'yandex'.encode ('UTF-8'), Byte = True)

Answer 1, Authority 100%

Use G.Doc.Text_Search

code in the end looks like this:

from grab import grab
G = grab ()
url = 'https://news.yandex.ru/index.rss'
G.go (URL)
Print (G.Doc.Text_Search (U'yandex'.encode ('UTF-8'), Byte = True))

Thanks to the user @soon

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions