A
A
Alexey2016-04-20 14:53:21
Python
Alexey, 2016-04-20 14:53:21

How to make a page parser using Grab?

Good afternoon!
I came across one problem related to parsing the site https://bankrot.fedresurs.ru/ArbitrManagerCard.asp...
I can't figure out how to navigate through the message pages. In the Form Data section (Network panel) there is a parameter with the value __EVENTARGUMENT=Page$2. I tried to add it in this way g.setup(post={'__EVENTARGUMENT':'Page$2'})to the example below, but there were no results, please tell me how to solve this problem. Thanks in advance!
Below is an example code:

from grab import Grab

g = Grab()
g.setup(document_charset='utf-8')
g.go('https://bankrot.fedresurs.ru/ArbitrManagerCard.aspx?ID=14431')

for messages in g.doc.select('//table[@id="ctl00_cphBody_gvMessages"]/tr'):
    for item in messages.select('./td[1]'):
         print(item.text())

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Kuts, 2016-04-20
@fox_12

Well, in addition to '__EVENTARGUMENT':'Page$2' , it also passes a bunch of parameters.
Intercept them too, and pass them with the request in the same way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question