Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I want to store response of the request in scrapy .i have the following code for the time being.
yield Request(requestURL,
callback=self.afterResponse)
Now what i want not to call the function afterResponse upon arrival of response but to store it here somehow so that i can extract the data of response at the same place.
Create some variable (it can be even list if you need to keep more data) in that spider and keep that data in it.
Or create/open some file and write it as pickle or something.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
Hey Im using my little scraper and I want to save results with one detail, first line of a raw pastebin/any other bin webpage.
lets say I have this code:
r=requests.get("https://pastebin.com/raw/qH03hKGU") #random link
text=r.text
I want to get the first line of the variable text without saving it (I will save just the one line)
You can use partition('\n')[0] to get the first line:
import requests
r=requests.get("https://pastebin.com/raw/qH03hKGU") #random link
text=r.text
print(text.partition('\n')[0])
OUT: import glob
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to know that is it have way to make a tempory list that it can add by input field and not save to server until click some button like add to cart button. I will use this for POS system.!
[example similar to this]
(https://i.stack.imgur.com/wEvKf.jpg)
Django comes with Form Wizard which might helps you.
You can use sessions or cookies to store data, both methods have a default WizardView that takes care of storing the data for you.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
What is the best way to export/store items in REST API ?
I want send scraped items to REST API, where should I put my
requests.post(...) ? Any examples ?
Thanks Rubber duck debugging, propably simple pipeline with process_item() method, earlier I thought only about Exporters and FeedStorage
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I was create one app which have model and it was created but i facing problem how to edit data in google data store using python or Django. Please Help me.
Fetch the record you want to edit (by key , id or any filter) , modify the field you want to edit and then put() it.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
Am going to design a game about raising dragons but don't know a way of saving my session/exp/stats so it would be pointless! Can't work out how to use pickle so can somebody give me an answer?
P.S.Simplify your answers as I am stupid
Here is a link for info on basic I/O in the standard library: http://docs.python.org/tutorial/inputoutput.html You will want to store the data from the game in some format (that is up to you) to a file, and then, later, you will read the file, and parse the data, and put it back into memory when the user comes back from a previous session.