Hi, looks like you are missing the formname argument. There are two forms
in the page and I assume you want the form with name 'TheForm':

In [12]: response.css('form')
Out[12]:
[<Selector xpath=u'descendant-or-self::form' data=u'<form action="home.php"
method="post">\r\n'>,
 <Selector xpath=u'descendant-or-self::form' data=u'<form method="post"
name="TheForm" id="T'>]

In [13]: req = FormRequest.from_response(response, formname='TheForm')

In [14]: req.url
Out[14]: 'http://www.rekrute.com/search_area.php'

Cheers,
Rolando


On Sat, May 23, 2015 at 12:09 PM, Amine Lemaizi <[email protected]>
wrote:

> I'm trying to scrap a set of data. To get the data needed I have to go
> through a certain "gate" where I have to determine filters for a form that
> uses onclick="__doPostBack('search','')" in order to get the list of data
> to scrap. (this is the "gate" url = "
> http://www.rekrute.com/search_area.php";)
>
> As you can imagine I didn't succeed...What I'm doing can be summarized
> (using the shell) as follow :
>
> from scrappy.http import FormRequest
> data = {
>         "__EVENTTARGET": "search",
>         "_STATE_":"",
>         "__EVENTARGUMENT":"",
>         "jobOffer_Sector_2":"",
>         "searchquery":"",
>         "jobOffer_Country[]":"134"}
> req = FormRequest.from_response(response, formdata=data)
>
> The reqvariable shows <POST http://www.rekrute.com/home.php>...what I was
> expecting is something like <POST http://www.rekrute.com/search_area.php>.
> So here I'm little bit confused.
>
> Am I doing it all wrong? I tried to read many issues on this matter
> (scrappy and __doPostBack) maybe I'm not having the right information to
> deal with it.
>
> --
> You received this message because you are subscribed to the Google Groups
> "scrapy-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/scrapy-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to