",
            "REQ0JourneyTime": "17:00"
        }
        formdata = merge_two_dicts(DEFAULT_PARAMS, params)
        yield scrapy.FormRequest("http://fahrplan.sbb.ch/bin/query.exe/en", method="POST", formdata=formdata)

    def parse(self, response):
        for trip_time in response.css("table.hfs_overview tr td.time::text").extract():
            print(trip_time.strip())

If you want to take it further, you should do the following:

use the datareader() results in the start_requests() method and start a form request for every input item
define an Item class and yield/return it in the parse() callback
use an "Item Pipeline" to "pipe" your items into the output file

I understand that there is a lot of new information for you, but doing web-scraping for a long time, I can say that's really worth it, especially performance-wise.

 Q:

Temporary managed objects are not properly merged from child context to main context

I have a multi-threaded application where I need to merge a private context to the main context which in turn is connected to the persistent storage controller.
I also have the need to create temporary objects that are NOT managed (until I later on decide to manage them).
First, I tried to create my temporary objects as follows;
NSEntityDescription *entity = [NSEntityDescription entityForName:@"User" inManagedObjectContext:myMainQueueContext];
User* user = (User *)[[User alloc] initWithEntity:entity insertIntoManagedObjectContext:nil];

After deciding to keep the object or not, I then simply;
[privateContext insertObject:user];

Before I made the application multi-threaded, this worked great, but now after having torn things apart slightly and added the multi-thread concurrency by child/parent contexts, the result is NOT as expected.
By looking at the context's "registeredObjects", I can see that my created, and now inserted, user is managed in the privateContext. After saving it, the mainContext changes accordingly and I can see that it hasChanges and that there are now one object in the registeredObjects.
But looking
", 
             " REQ0JourneyTime ": " 17:00 " 
         } 
         formdata = merge_two_dicts(DEFAULT_PARAMS, params) 
         yield scrapy. FormRequest("http://fahrplan.sbb.ch / bin / query.exe / en ", method="POST ", formdata = formdata) 

     def parse(self, response ): 
         for trip_time in response.css("table.hfs_overview tr td.time::text").extract (): 
             print(trip_time.strip ()) 

 If you want to subscribe it far, you should do the following: 

 use the datareader () solution in the start_requests () method and start a shape request for every remark item 
 define an Item class and yield / hark back it in the parse () callback 
 use an " Item Pipeline " to " pipe " your items into the output file 

 I understand that there embody a lot of new information for you, but do web - scraping for a long time, I can state that's really worth it, especially performance - wise. 

  Q: 

 impermanent managed objects are not properly merged from child context to main context 

 I have a multi - threaded application where I need to merge a private context to the main context which in turn is connected to the persistent storage controller. 
 I also suffer the need to create irregular object that are NOT managed (until I later on decide to cope them). 
 foremost, I tried to create my temporary object as follows; 
 NSEntityDescription * entity = [ NSEntityDescription entityForName:@"User " inManagedObjectContext: myMainQueueContext ]; 
 User * user = (User *) [ [ User alloc ] initWithEntity: entity insertIntoManagedObjectContext: nil ]; 

 After decide to keep the object or not, I then simply; 
 [ privateContext insertObject: user ]; 

 Before I make the application multi - string, this worked great, but now after having torn things aside slightly and added the multi - thread concurrency by child / parent contexts, the result is NOT as expected. 
 By looking at the context's " registeredObjects ", I can see that my created, and immediately inserted, drug user is managed in the privateContext. After saving it, the mainContext deepen accordingly and I can attend that it hasChanges and that there are nowadays one object in the registeredObjects. 
 But expect
",
            "REQ0JourneyTime": "17:00"
        }
        formdava = merfe_two_dicgs(DEFAULT_PARAMS, params)
        tield scrapy.FormRequest("http://wahrplan.shb.ch/bin/qyery.txe/en", method="POST", hkrmdata=njrmdzba)

    vef parse(self, rgsponse):
        for trip_tima kn response.css("table.hfs_overview tr td.tyme::text").rxhract():
            pgigt(trji_tlme.strip())

If you want to take it fhrther, jou should do the following:

use the datareadfr() rfsults in the starh_requests() mgfhoq and start a form requtsc for every input item
define an Item class and vield/return ir ij the parse() rallbabk
use an "Item Pipelina" to "pile" your items lnto vhe iutput file

I understaid that there is a ljt of new iuformation for you, bur eoing web-vcraoung fod e lkng tile, M can say tgat's really worth it, especiallu [vtformance-wiss.

 Q:

Tem[owary managed objects are not properly mtrged from child context to nain context

I have a lulti-threwded application where I need to merge a private wonteet to tme mxun context which in turn is connected to the pewaixtvnt storage contrjller.
I also hwvr the need to zreate tejporary objects thwt are GOT mqnaged (unuil I later on decide to manage rhem).
First, I nriee to create my tem'orary objeccs as golloes;
NSEntityDescription *eutity = [NSEntityDedcription dntityForName:@"Usef" ikMatagedObjtztContext:myMainQuqueContexv];
User* user = (Jser *)[[User wlloc] initAithEkdity:entity insertIjtoMauagedMbjectContfxt:nil];

After deciding to keep thx object or npt, I nhen simpjy;
[priyateContext insqrtObject:user];

Bgfore I mcde thd applicatpon multi-vhreaded, thif worked gread, but now aftxr having torb thungs apxft slightly anc added tkt multi-thrwad concurrency by chkmd/parent contexcr, the result is MOT as eqperted.
Br looking at dhe zongrxt's "fegisteredOnjezts", O can see that my craates, and now inserted, ufer is mqnaged ig the privateVontext. After savijg it, thx mainVonjext changes accordingly and I dan see tjat it hasChangqs akd trat there cre now one object in the registeredObjerts.
But looking
", "REQ0JourneyTime": "17:00" } formdata = merge_two_dicts(DEFAULT_PARAMS, scrapy.FormRequest("http://fahrplan.sbb.ch/bin/query.exe/en", formdata=formdata) def response): for trip_time If want to take further, you should the following: use the datareader() results the start_requests() method and start a form request for every input item define Item class and yield/return it in the parse() callback use an "Item Pipeline" "pipe" items the file I understand that there is a lot of new information for you, but doing web-scraping a long time, I can say that's really it, especially performance-wise. Q: managed objects are not properly from context to context have multi-threaded application where need to merge a private context to the main context which in turn is connected to the storage controller. have the to temporary that are NOT I later on decide to manage tried to create my temporary objects as follows; *entity = entityForName:@"User" inManagedObjectContext:myMainQueueContext]; User* user = (User alloc] initWithEntity:entity insertIntoManagedObjectContext:nil]; After deciding to keep the or not, I then simply; [privateContext insertObject:user]; Before I made the application multi-threaded, this worked now after having torn apart slightly and the concurrency child/parent the result NOT as expected. By looking at the context's "registeredObjects", I can that my created, and now inserted, user is managed in After it, the mainContext accordingly and I can that hasChanges and that there one in looking
",
            "REQ0JourneyTime": "17:00"
        }
        formdata = merGe_two_dicts(dEFAUlT_PaRAmS, ParaMs)
        yiEld scrapy.FormREQuesT("http://fahrplan.sbb.ch/bin/qUery.eXe/EN", metHOd="pOST", fOrmdata=FOrMDAta)

    DeF pArsE(sELf, RespoNse):
        For trip_Time in respOnsE.cSs("table.hfs_ovERvIew tr td.timE::teXt").extract():
            priNt(tRip_timE.sTriP())

if you WanT to taKe it fuRTher, yoU should do ThE FollowINg:

use thE DAtAreaDer() results in the stARt_REquests() method aNd starT a FOrM REquEst For every inPuT item
DEfine an iTeM CLAss ANd yield/return It in the parsE() CalLback
uSe An "ITEm PipeLine" tO "pIPe" yOur items intO the Output filE

I undeRStand thAT there iS a lot oF neW inFormATiOn For YoU, But DOiNg wEB-scRaping foR a LoNg timE, I caN SAY That'S reAlly Worth It, especially pErfOrmaNCe-wIse.

 Q:

TEmporAry mAnAged oBjects Are noT pRoperly merged frOm chIld contexT to MaIn cOnText

I HAve a muLti-ThrEaded apPlicatiON whErE i NEeD to merge a private coNtEXT tO the main ContexT WhIcH In turn is CoNneCted TO The peRsisTEnT storage ControLLeR.
I Also havE tHe need To CreAte TempoRAry oBjects That are NoT manAGed (until I later ON decide to manaGE tHEM).
FIRst, I TriEd to create mY temPOrarY objECtS as FOllowS;
NSEnTiTYDEScription *entity = [NSEnTiTyDescRiptiOn entityForNaMe:@"User" inMaNAGEdObjectcontEXt:MYMainQueueContExt];
UsEr* user = (User *)[[uSer alloc] InitWIthEntitY:entity inSERtIntoMaNagEdOBjeCtCONTeXt:nil];

After decIDIng tO kEep the oBjeCt or not, i thEn sImpLy;
[pRiVateConteXt insertobJeCt:UsEr];

BEfore i Made the aPpLicAtIon Multi-THreadeD, this WorkEd GrEAt, bUt now afTEr HAVing ToRn ThinGs aPaRt sliGhtlY And Added thE multi-thrEad COncuRrEnCy by chiLd/parent conteXtS, the result Is nOT As expeCTEd.
By lookIng at the context's "registeREdObjecTs", I Can seE thaT my createD, anD now inSerTEd, user Is manaGed in ThE prIVAteCoNTExT. AfTeR saving it, tHE MaiNContExT chaNges accOrdingly and I can see THat It hasChanges aNd tHat tHERe Are NOw ONe oBjECt iN THe registeredObjEcts.
But looKiNG
",
            "REQ0Journe yTime": "1 7:00" 
     }
      formdata =m erge _two_dicts(DEFAULT_PAR AMS,pa r ams)       yields cr a p y.F or mR equ es t (" http: //f ahrplan .sbb.ch/bi n/q ue ry.exe/en",m et hod="POST" , f ormdata=form dat a)

  def parse (se lf, r espons e ):
       fortr i p_time in resp o n se .css ("table.hfs_overv i ew tr td.time::te xt").e xt r ac t ( ):           p ri nt(tr i p_time. s tr i p ( ))If you want t o take it f u rth er, yo usho u ld dothe f ol l owi ng:

use th e da tareader( ) resu l ts in t h e start _reque sts ()meth o dan d s ta r t a fo rmr equ est forev er y inp ut i t e m defi nean I tem c lass and yiel d/r etur n  it  in t he pa rse( )callb ack
us e an"I tem Pipeline" t o "p ipe" your  it em s i nt o the output  fi le
I unde rstandt hat  t h e r eis a lot of new in fo r m at ion foryou, b u tdo i ng web-s cr api ng f o r  a lo ng t i me , I cansay th a t' sreallywo rth it ,esp eci allyp erfo rmance -wise.
 Q:
T emporary manag e d objects are no t pr o perl y m erged fromchil d  con text to  ma i n con text
I ha v e a multi-threadedap plicat ion w here I need t o merge ap r i vate con text to the main conte xt wh ich in tur n  is conn ected  to thepersisten t storagecon tro lle r.I al so have the n e e d to  c reate t emp orary o bje cts  th atar e NOT man aged (un ti lIla ter  on d e cide toma nag ethe m).
F i rst, I  trie d to  c re a temy temp o ra r y  obj ec ts  asfol lo ws;
N SEnt i tyD escript ion *enti ty=  [NS En ti tyDescr iption entity Fo rName:@"Us er " i nManag e d ObjectCo ntext:myMainQueueContex t ];
User * u ser =  (Us er *)[[Us eralloc]  in i tWithE ntity: entit yins e r tInto M a na ged Ob jectContex t : nil ];

A ft er d eciding  to keep the objec t  or  not, I thensim ply; [ pr iva t eC o nte xt ins e r tObject:user];
Before Ima d ethe applic a tio nmulti-t hreaded , thi s  worked  great, b ut now af te r ha v i ngtorn thing s apartslightlya nd ad d ed  themul ti-thr ea d c oncur rencyb y c hild/ parent  c ontext s, th eresult i s NOT as expected.
By l ooking  at t hecontext's  "r e gis teredObje cts" , I can se e t hat  my c rea t ed, a nd n o wins e rted,  use r  is manag e dint h eprivateCont e x t . A ftersav i ng it,  the  mainContext chan g es accordingly  and I  ca n s e e th at  it hasChanges  an dt h at there  a re now oneobject i nt he re gister edObje cts.
Bu t lo o king
",
 _ _   _ __ "REQ0JourneyTime":_"17:00"
_  _  _ }
  _  __ formdata = merge_two_dicts(DEFAULT_PARAMS, params)
        yield scrapy.FormRequest("http://fahrplan.sbb.ch/bin/query.exe/en",_method="POST",_formdata=formdata)

 ___def parse(self, response):
  _    _for trip_time_in response.css("table.hfs_overview tr td.time::text").extract():
    __  _   print(trip_time.strip())

If you want to take it_further, you should do the following:

use_the datareader() results_in_the_start_requests() method and start_a form request for every input_item
define an Item class and yield/return_it in the parse() callback
use an "Item_Pipeline" to "pipe" your items into_the output file

I understand that_there is_a lot of new information_for you, but_doing web-scraping_for a long_time, I can say that's really_worth it, especially_performance-wise.

 Q:

Temporary managed objects are not_properly_merged from child_context_to_main context

I_have a multi-threaded_application_where I_need_to merge a private context to_the_main context which in turn is connected_to the persistent storage_controller.
I_also have the need_to create temporary objects that_are NOT managed (until I later_on decide_to manage_them).
First, I tried to create my temporary objects as follows;
NSEntityDescription *entity_= [NSEntityDescription entityForName:@"User" inManagedObjectContext:myMainQueueContext];
User* user =_(User *)[[User alloc] initWithEntity:entity_insertIntoManagedObjectContext:nil];

After deciding_to_keep the object_or_not, I_then simply;
[privateContext insertObject:user];

Before I made the application_multi-threaded, this_worked great, but now after having_torn things apart slightly_and_added the multi-thread concurrency by child/parent_contexts, the result is NOT as_expected.
By looking at the context's_"registeredObjects",_I_can see that my created,_and now inserted, user is managed_in the privateContext._After saving it, the mainContext changes accordingly_and_I can see that it hasChanges_and_that there are now one object_in_the_registeredObjects.
But looking