I nte rna t io na l J o urna l o f   Adv a nces in Applie d Science s   ( I J AAS)   Vo l.   4 ,   No .   4 Dec em b er   201 5 ,   p p .   146 ~ 150   I SS N:  2252 - 8814          146       J o ur na l ho m ep a g e h ttp : //ia e s jo u r n a l.c o m/o n lin e/in d ex . p h p /I J AAS   Co m m o dity  Price  Data  Analy sis  Us ing  Web  S crap ing       M .   K a m e s w a ra   Ra o ,   Ro hit  L a g is et t y ,   M .   S.   V.   K .   M a nira j ,   K .   N.   S.  Da t t u,  B .   Sn eha   G a ng a   K.   L.   Un iv e rsit y ,   V a d d e sw a ra m ,   G u n tu r,   A n d h ra p ra d e sh ,   I n d ia       Art icle  I nfo     AB ST RAC T     A r ticle  his to r y:   R ec eiv ed   Sep   20 ,   2 0 1 5   R ev i s ed   No v   18 ,   2 0 1 5   A cc ep ted   No v   2 9 ,   2 0 1 5       T o d a y ,   a n a l y sis  o f   d a ta  w h ich   is  a v a il a b le  o n   th e   w e b   h a b e c o m e   m o r e   p o p u lar,   b y   u sin g   su c h   d a ta  w e   a r e   c a p a b le  to   so lv e   m a n y   issu e s.  Ou p r o jec d e a ls  w it h   th e   a n a l y sis  o f   c o m m o d it y   p rice   d a ta   a v a il a b le  o n   th e   we b .   In   g e n e ra l,   c o m m o d it y   p rice   d a ta  a n a ly sis  is  p e r f o r m e d   to   k n o w   in flatio n   ra te  p re v a il in g   in   th e   c o u n try   a n d   a ls o   to   k n o w   c o st  p rice   in d e x   (CP I).   P re se n tl y   in   so m e   c o u n tri e th is  a n a ly sis  is  d o n e   m a n u a ll y   b y   c o ll e c ti n g   d a ta  f ro m   d if fe re n c it ies ,   th e n   c a lcu late   i n f latio n   a n d   C P u si n g   so m e   p re d e f in e d   f o r m u lae .   T o   m a k e   th is  e n ti re   p ro c e ss   a u to m a ti c   w e   a r e   d e v e l o p i n g   th is   p ro jec t.   N o w   a   d a y ’s  m o st  o f   th e   c u sto m e rs  a re   d e p e n d in g   o n   o n li n e   w e b site s   f o th e ir  d a y   to   d a y   p u rc h a se s.  T h is  is  th e   re a so n   we   a re   i m p lem e n ti n g   a   s y ste m   to   c o ll e c th e   d a ta  a v a il a b le  in   v a rio u e - c o m m e r c e   sites   f o c o m m o d it y   p rice   a n a l y sis.  He r e ,   we   a r e   g o in g   to   in tro d u c e   a   d a ta  sc ra p in g   tec h n iq u e   w h ich   e n a b les   u to   c o ll e c d a ta  o f   v a rio u p ro d u c ts   a v a il a b le   o n li n e   a n d   t h e n   sto re   it   i n   a   d a tab a se   th e re   a f ter  we   p e r f o r m   a n a l y si s o n   th e m .   B y   th is  p ro c e ss   w e   c a n   re d u c e   th e   b u rd e n   o f   c o ll e c ti n g   d a ta  m a n u a ll y   b y   re a c h in g   v a rio u c it ies .   T h e   sy st e m   c o n sists   o f   w e b   m o d u le  w h ich   p e rf o rm   a n a ly sis a n d   v isu a li z a ti o n   o f   d a ta  a v a il a b le i n   th e   d a tab a se .   K ey w o r d :   C o m m o d it y   C P I   I n f lat io n   Scr ap in g   Vis u a lizatio n   Co p y rig h ©   201 5   In s t it u te o A d v a n c e d   E n g i n e e rin g   a n d   S c ien c e   Al rig h ts  re se rv e d .   C o r r e s p o nd ing   A uth o r :   M.   Ka m es w ar R ao ,   K.   L.   Un i v er s i t y ,   Vad d es w ar a m ,   Gu n t u r ,   An d h r ap r ad esh ,   I n d ia .   E m ail:  k a m e s h . m ac h ir aj u @ k l u n i v er s i t y . i n       1.   I NT RO D UCT I O N   W eb   s cr ap in g   is   s o f t w ar tec h n iq u e   u s ed   f o r   s cr ap p in g   t h d ata  av ailab le  in   v ar io u s   w eb s ites   a n d   it   u s e s   th m o s u n iv er s a tech n iq u e s   ad o p ted   b y   m a n y   s ea r ch   en g i n e s .   W eb   s cr ap in g   m ai n l y   f o cu s s es  i n   co n v er ti n g   u n s tr u ct u r ed   d ata  av ailab le  i n   w eb s ites   i n to   s tr u ctu r ed   f o r m at.   T h d ata  p r ese n i n   w eb s ites   is   i n   s e m i - s tr u ct u r ed   f o r m at  p lace d   in   b et w ee n   h t m tag s .   Af t er   p er f o r m i n g   s cr ap in g   d ata  is   s to r ed   in   lo ca d atab ase  o r   s p r ea d s h ee ts   to   p er f o r m   an al y s is .     C o m m o d it y   p r ice  d ata  an al y s i s   is   p er f o r m ed   b y   co llecti n g   t h d ata  a v ailab le  i n   v ar io u s   e - co m m er ce   w eb s i tes.  T o   m in th d ata  a v ailab le  o n li n w ar u s i n g   web   s cr ap in g .   W eb   s cr ap in g   is   s o f t w ar tec h n iq u w h ic h   is   u s ed   f o r   w eb   d ata  ex t r ac tio n ,   it  in d ex e s   th i n f o r m a tio n   av ailab le  o n   w eb   u s i n g   w eb   cr a w ler   w h i c h   is   u n i v er s al   tec h n iq u ad o p ted   b y   m an y   s ea r ch   e n g i n es.  S cr ap in g   ca n   b d o n e   b y   u s in g   P y th o n ,   J av o r   b y   u s i n g   s o m A P I s   w h ich   ar av ailab le  o n l in e.   I n   o u r   p r o j ec w ar p er f o r m i n g   s cr ap in g   b y   u s i n g   S C R A P Y   to o p y t h o n   b ased   f r a m e w o r k   d ev elo p ed   f o r   w e b   d ata  ex tr ac t.  SC R A P co n tai n s   s o m p r ed ef in ed   lib r ar ies  w h ic h   e n ab les  u s   to   p er f o r m   d ata  ex tr ac f r o m   o n li n a n d   m ak e s   o u r   w o r k   ea s ier .   B y   s c r ap in g   t h e   w eb   d ata   w ca n   al s o   p er f o r m   p r ice  co m p ar i s o n s ,   W ea th er   d ata  m o n ito r in g ,   W eb s ite  ch a n g d etec t io n ,   R es ea r ch ,   W eb   d ata  in teg r atio n   etc.   I n f latio n   r ef er s   to   ch a n g i n   le v el  o f   p r ices  in   a n   ec o n o m y   o v er   p er io d   o f   ti m an d   C P I   m ea s u r es  t h p r ice  lev el  c h a n g e s   o f   co n s u m er   g o o d s   an d   s er v ices  p u r ch a s ed   b y   h o u s e h o ld s .   I n f latio n   a n d   C o s P r ice  I n d ex   ( C P I )   ca n   b ca lcu lated   b y   u s i n g   d ata  o f   p r esen a n d   p r ev io u s   y ea r s .     So ,   th er is   n ee d   to   m ai n tai n in g   t h r ec o r d s   o f   p r ev io u s   y ea r s   also .   W eb   cr a w l er s   g o es  to   w eb s ite  as   s p ec i f ied   i n   t h p r o g r a m   an d   co llects  th d ata   av ai lab le.   Af ter   e x tr ac ti n g   d ata  is   m ai n tai n ed   in   th e   d atab ase  t o   p er f o r m   v ar io u s   Evaluation Warning : The document was created with Spire.PDF for Python.
IJ AA S   I SS N:  2252 - 8814       C o mmo d ity  P r ice  Da ta   A n a lysi s   Usi n g   W eb   S cra p in g   ( M.  K a mesw a r a   R a o )   147   o p er atio n s   o n   t h e m .   Data   a v ai lab le  in   t h d atab ase  is   v is u ali ze d   to   th u s er   i n   t h f o r m   o f   b ar   ch ar ts   a n d   lin e   ch ar ts .           2.   RE L AT E WO RK   T h av ailab ilit y   o f   o n - li n co s ts   r ep r ese n ts   a   s i n g u lar   c h a n ce   f o r   th e   d ev elo p m e n o f   v al u i n d ex es   an d   also   t h m ea s u r o f   i n f la ti o n   r o u n d   t h w o r ld .   As  tec h n o lo g y   is   g r o w i n g   d a y   b y   d a y   t h d ail y   n ee d   ite m s   w er also   b ein g   s o ld   in   o n l in e   m ar k et.   So   to   co m p ar th p r ices  o f   th p r o d u cts  t h at  ar in   o n lin an d   o f f li n e   an   alg o r ith m   is   d e v elo p ed   w h ich   s cr ap s   th d ata  s u c h   as  p r o d u ct  n a m an d   p r ice  an d   b y   u s i n g   th i s   d ata  w ca n   ca lcu late  t h co s p r ice  in d ex   ( C P I ) ,   in f latio n   f o r   p ar ticu lar   p er io d   o f   ti m b u d is ad v an tag i s   th at  a f ter   s o m ti m t h li m itatio n   m a y   r ec ed an d   it d o es n o t in cl u d an y   a n al y s i s   o r   n u m b er   o f   q u a n titi e s   s o ld .     I n f o r m a tio n   i s   lar g e l y   a v ailab le  o n   th e   w eb   d ata  b ase,   if   a n y o n w a n ts   to   r etai n   s o m a m o u n o f   in f o r m atio n   h m u s b o o k m ar k   th w eb   p ag s o   to   av o id   s u ch   th in g s   s ea r ch   e n g i n e s   ar th er w h ic h   s ea r c h e s   r elate d   in f o r m a tio n   o n   t h en t ir w eb .   As  it  is   al s o   t y p o f   s cr ap in g   w h ich   e x tr ac ts   t h d ata  s o   w ca n   al s o   s cr ap th e   s p ec i f ic  d ata  in   w eb s i te.   So m o f   t h s ea r ch   en g i n e s   ar C h ick e n f o o w h ic h   i s   a   f ir e f o x   p lu g i n   th at  p r o v id es   t h p r o g r a m m i n g   e n v ir o n m e n t   t o   m an ip u late  o r   g et  w eb   p ag e   co n te n t s   a n d   it  is   w r itte n   i n   j av a   s cr ip to   w r ap   t h co n ten t.   A s   it  is   p lu g i n   it   w a s   e m b ed d ed   i n   a   w eb   b r o w s er   an d   w ill   r u n   s lo w l y   as   it  p r o ce s s   th j av s cr ip t a n d   aj ax   ca lls .   I t in ter ac ts   a n d   s cr ap s   th d ata  f r o m   t h w eb   b r o w s er   u s in g   f i n d ( )   co m m a n d .   B asicall y   w eb   cr a w li n g   m ea n s   p r o g r a m   w h ic h   g o es   th r o u g h   t h f u ll  HT ML   co d o f   t h w eb s i te  b y   tr av er s i n g   t h w eb p ag e s   o f   t h s ite  an d   g ets  all  th r ele v an t   in f o r m atio n   r eq u ir ed   f o r   th u s er   is   o b tai n ed   an d   th is   i s   iter ativ p r o ce s s   f o r   g etti n g   m o r s p ec if ic  i n f o r m atio n   r eq u ir ed   f o r   th u s er .   T h ac cu r ac y   o f   th e   alg o r ith m   w i ll  b b ased   o n   th f r eq u en c y   o f   o cc u r r en ce   o f   k e y w o r d s   in   t h w eb p a g an d   lo ca tio n   o f   k e y w o r d s   i n   th s ite.   T h er ar s ev er al  ty p es o f   W eb   C r a w li n g   Stra te g ie s .   T h e y   ar e:   1.   B r ea d th   First Sear ch   A l g o r ith m   2.   Dep th   First  Sear ch   A l g o r ith m   3.   P ag R an k   A l g o r ith m   4.   Gen etic  al g o r ith m     2 . 1 .   B re a dth  F irst  Sea rc h Alg o rit h m   I n   th is   al g o r ith m   u n if o r m   s ea r ch   is   d o n alo n g   all  th n eig h b o r in g   n o d es  w h ich   s tar ts   f r o m   r o o t   n o d an d   all  th n ei g h b o r in g   n o d es  th at  ar at  th s a m le v el  o f   r o o n o d [ 1 ] .   I f   th u s er   r eq u ir ed   d ata  is   o b tain ed   th e n   th e   s ea r ch   i s   r e p o r ted   as  s u cc e s s   an d   th e   s ea r ch   g ets   ter m in a ted   b y   g ett in g   all  t h r eq u ir ed   d ata   b u if   th s ea r c h   d o esn m atc h   w ith   t h u s er   r eq u ir e m e n t h en   it  g o es  d o w n   to   n ex le v e an d   s ea r ch   w ill  b d o n at  all  th n ei g h b o r in g   n o d es  o f   th at  le v el  a n d   th i s   p r o ce s s   w ill  co n tin u ti ll  th u s er   r eq u ir ed   d ata  is   o b tain ed .   B u w h en   al l n o d es  ar s ea r ch ed   an d   th r eq u ir ed   d a ta  is   n o t o b tain ed   th e n   it r es u lts   a s   f ail u r e.     2 . 2 .   Dept h F irst  Sea rc h Alg o rit h m   I n   d ep th   f ir s s ea r ch   al g o r ith m ,   n o d es  ar tr av er s ed   s y s te m at icall y   f r o m   t h s tar ti n g   o f   f ir s t   n o d an d   tr av er s i n g   w i ll  b d o n till   th e   en d   o f   th la s ch ild   n o d e.   W h en   t h er ar m o r th a n   o n c h ild   n o d th e n   le f t   n o d w ill  b g iv e n   t h m o s p r io r ity .   T h en   it  w i ll  b b ac k   tr ac k ed   to   all  th u n v is ited   n o d es  till   all  t h n o d es   ar v is ited   [ 2 ] .   I n   th is   al g o r ith m   al th n o d es  ar v is ited   o n ce   w h e n   th b r ea d th   is   v is ited   [ 3 ] .   B u th e   d is ad v an ta g o f   th is   al g o r ith m   is   th a w h e n   t h er ar m o r n o d es  an d   b r an c h es  t h e n   it  m a y   r esu lt  i n f in i te   lo o p   [ 4 ] .     2 . 3 .   P a g Ra nk   Alg o rit h m   T h is   alg o r it h m   h elp s   u s er   in   d eter m i n in g   th e   i m p o r ta n ce   o f   w eb p ag   b y   ca lc u lati n g   to t al  n u m b er   o f   cita tio n s   an d   b ac k li n k s   t h at  ar p r esen t in   t h w eb p ag [ 5 ] .     P r ( W )   ( 1 - d )   d ( P r ( l 1 ) /C ( l 1 )   …. .   P r ( l n ) /C ( l n ))   P r ( W )   ---   P ag r an k   f o r   th w e b s ite  th at  i s   b ein g   ca lcu la ted   - - -   Da m p i n g   f ac to r   o f   th web s ite   (l …  l n ---   li n k s   a n d   citatio n s   p r esen t in   t h e   w eb p ag e   B y   co n s id er in g   h u m a n   f ac to r   n e w   al g o r ith m   o f   P ag r a n k in g   is   d e v elo p ed   b y   Yo u g b i n   Qi n   a n d   Dao y u m   X u   [ 6 ]   an d   t h is   in tr o d u ce d   r ec o m m en d atio n   m ec h an i s m   alo n g   w i th   p a g b eli ef   a n d   th i s   cr ea ted   b alan ce d   r an k   alg o r it h m   o f   p a g r an k i n g   an d   g i v es  i m p o r t an ce   to   th n ee d s   o f   u s er s .   T h is   ef f ec tiv e l y   a v o id ed   to p ic  d r if t p r o b lem .   A   n e w   p ag r an k i n g   alg o r it h m   w it h   t h co m b in a tio n   o f   s ta tic  alg o r ith m   o f   p a g r an k   w it h   clas s if ied   tr ee   is   p r o p o s ed   b y   T ian   C h o n g   [ 7 ]   w h er class if ied   tr ee   is   co n s tr u cted   w h ic h   is   u s ed   b y   lar g n u m b er   o f   u s er s   an d   g etti n g   s i m ilar   r es u l ts   w h ile  s ea r ch i n g   a n d   t h is   h e lp s   in   r ed u ci n g   t h p r o b le m   o f   t h e m d r if w h ile   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 2 5 2 - 8814   IJ AA S    Vo l.   4 ,   No .   4 Dec em b er   201 5   :   1 4 6     1 5 0   148   s ea r ch i n g   u s in g   o n l y   p ag r a n k   alg o r it h m   an d   o u td ated   p ag es  w ill b eli m i n ated   ea s il y   a n d   in   t u r n   i f   i n cr ea s e s   th ef f ec ti v e n es s   o f   t h s ea r ch in g   a n d   th e f f icie n c y   o f   th s ea r ch in g   al g o r ith m .     2 . 4 .   G enet ic  Alg o rit h m   Gen etic  al g o r ith m   w o r k s   u s i n g   b io lo g ical  ev o l u tio n s   an d   in   it  th o f f s p r in g   t h f its   is   o b tain ed   b y   cr o s s in g   it  o v er   th s elec ted   b est  p o p u latio n   in d iv id u als  b y   u s in g   s o m f it n ess   f u n ctio n s .   So m p r o b le m s   p r esen in   t h is   b u it  is   s u i tab le  f o r   b est  s o lu tio n   in   s p ec i f i ti m [ 8 ] .   So   th is   s u it s   to   th u s er   w h o   h a s   n o   o r   ti m to   s ea r ch   h u g d atab ase   an d   g et  v er y   ef f icie n t r es u lt s   [ 9 ] .     2 . 5 .   AP I   T o o ls   No w   d a y s   s cr ap in g   d ata  f r o m   t h w eb s ites   b ec o m e s   m o r im p o r tan an d   it  is   al s o   u s e f u f o r   p er f o r m in g   a n al y s i s   o n   t h d at co llected .   W ca n   co llect  t h d ata  u s i n g   s o m A P I   to o ls   s u ch   as   w eb   s cr ap er ,   i m p o r t.io ,   k i m o n o   etc. ,   W eb   Scr ap er   [ 1 2 ]   is   to o w h i c h   is   u s ed   to   cr ea te  s ite  m ap s   an d   b ased   o n   th e s m ap s   w e   ca n   n a v i g ate  th r o u g h   t h p ag f o r   ex tr ac ti n g   t h d ata.   Usi n g   s elec to r   o p tio n   in   t h t o o w e   ca n   n a v i g at e   an d   ex tr ac d if f er e n t y p es  o f   d ata  s u ch   as   lin k s ,   te x ts ,   tab les,  i m ag e s   etc.   W eb   s cr ap er   ca n   al s o   s cr ap t h e   d y n a m ic  d ata.   Af ter   e x tr ac tin g   w ca n   d o w n lo ad   th d ata  f r o m   th b r o w s er   as c s v .   Ki m o n o   [ 1 0 ]   is   also   o n o f   t h b est  A P I   to o f o r   s cr ap in g   th w eb   d ata,   it  is   b o o k m ar k   in   th e   b r o w s er .   Ki m o n o   p r o v id es th e   f u n ctio n alit y   o f   s elec tin g   t h m u ltip le  ite m s   s u c h   as te x t,  li n k s ,   an d   i m a g es a t a   ti m e   an d   ca n   b e   ca teg o r ized   ac co r d in g l y   i n   t h d ata   m o d e llin g   o p tio n   o f   th e   k i m o n o   b o o k m ar k   tab .   Af ter   ex tr ac ti n g   d ata  it  also   ca n   b d o w n lo ad ed   lik e w is w eb   s cr ap er   to o an d   it  ca n   b e   f u r th er   u s ef u in   p er f o r m i n g   an al y s is .   K i m o n o   to o l h as a ls o   th f u n ctio n al it y   o f   s a v in g   t h e   cr ea ted   A P I   an d   b u ild in g   ap p s   f o r   th m o b ile.   I m p o r t.io   [ 1 1 ]   is   an o th er   A P I   to o f o r   cr a w li n g   t h d at p r esen in   th e   w eb .   I i s   b r o w s er   ap p licatio n   w h ic h   u   n ee d   to   i n s tal l.  Usi n g   t h i s   to o w ca n   cr a w t h d ata  w it h in   th e   s i n g le  p ag a n d   also   t h d ata  w h ic h   i s   s i m ilar   i n   m u lti p le  w eb   p a g es   o f   a   w eb s ite,   f i r s w n ee d   to   s elec t h d ata   w h at  w w a n a n d   p r o v id co lu m n   n a m e s   af ter   th at  w h i le  r u n n i n g   t h cr a w ler   w h a v to   p r o v id th m a i n   p ag u r w h ich   w e   h ad   s elec ted   th e   d ata  an d   a l s o   th e   d ep th   o f   t h p ag e s   t h cr a w ler   n ee d s   to   n av i g ate  s o   th at   t h cr a w ler   n av i g ate s   ac co r d in g l y   an d   d o w n lo ad s   th d ata  i n   cs v   f o r m a t .       2 . 6 .   B ea utif ul So up   B ea u tifu s o u p   [ 1 3 ]   is   p y t h o n   lib r ar y   w h ic h   i s   u s ed   to   wr ap   o u th e   d ata  f r o m   t h h t m an d   x m l   d o cu m en ts .   Usi n g   b ea u ti f u s o u p   w ca n   s cr ap   th d ata  w h atev er   w w a n f r o m   v ar io u s   w eb s i tes  an d   it  al s o   p r o v id es th m eth o d s   w h ic h   i s   i m p le m en ted   i n   p y t h o n   f o r   n a v ig a tin g ,   s ea r c h i n g   a n d   m o d i f y in g   t h tr ee   t h at  is   p ar s ed   w h ic h   m ea n s   g e tti n g   t h d ata  w h a tev er   w n ee d .   T o   m a k u s o f   b ea u ti f u s o u p   w s h o u ld   in s tall  t h is   lib r ar y   in   a n y   o f   th e   p y t h o n   in s taller s   s u c h   a s   p ip .   Fo r   s cr ap in g   th e   d ata  f ir s w e   n ee d   to   p r o v id th u r o f   t h e   p ag an d   t h en   i s h o u ld   b p ass ed   to   s o u p   m eth o d ,   af ter   th a it  w ill  p ar s all  t h p a g es  a n d   g ets  t h d ata.   T h d ata  w h at  w g et  is   alo n g   w i t h   th tag s   s o   to   id en ti f y   an d   e x tr ac th e x ac d ata  co n te n a n d   g et  m et h o d s   ar u s ed .   Fi n all y   th s cr ap ed   d ata   s h o u ld   b ex p o r ted   to   ex ce f il a n d   f o r   th is   c s v   l ib r ar y   s h o u ld   b i m p o r ted .   B ea u tifu l so u p   ca n   p ar s an y   d ata  w h a tev er   w g iv a n d   f et ch es d if f er e n t t y p e s   o f   d ata  lik lin k s ,   tex ts   etc.         3 .     P RO P O SE M E T H O D   Data   r eq u ir ed   f o r   p r ice  an al y s is   ca n   b co llec ted   u s i n g   s ea r ch in g   tec h n iq u e.   T o   co llect  d ata  u s i n g   s ea r ch i n g   tec h n iq u w e   in itiall y   n ee d   to   p r o v id k e y w o r d s   o f   th e   p r o d u ct  to   t h p r o g r a m   t h en   it   s ea r c h   f o r   th e   p r o d u ct  n a m i n   h t m co d e.   On ce   t h p r o d u ct  n a m i s   f o u n d   t h p r o g r a m   p er f o r m s   f r o n an d   b ac k w ar d   tr av er s als  to   f i n d   th p r ice  o f   th p r o d u ct  an d   g e th p r ice  d ata.   B u tr av er s i n g   e n tire   h t m co d f o r   p r o d u ct  n a m a n d   p r ice  in cr ea s es  th e   ti m co m p lex it y   o f   th p r o g r a m   an d   th d ata  co llected   m a y   n o b ef f icien t.  T h er m a y   b also   s o m s itu a tio n s   w h er th d ata  is   n o av ailab le  in   t h h t m co d e.   So ,   I n   o r d er   to   p r o v id ef f icien m et h o d   to   m i n th d ata  w h av p r o p o s ed   th f o llo w i n g   m et h o d .       Evaluation Warning : The document was created with Spire.PDF for Python.
IJ AA S   I SS N:  2252 - 8814       C o mmo d ity  P r ice  Da ta   A n a lysi s   Usi n g   W eb   S cra p in g   ( M.  K a mesw a r a   R a o )   149   W eb   cr aw ler   p er f o r m   i n d ex i n g   s a m as  s ea r ch   e n g in a n d   r ea ch es  t h w eb s ite  p r o v id ed   b y   th u s er .   Scr ap er   alg o r ith m   h elp s   u s   to   r ea ch   to   th d ata  an d   g et  th d ata  as  p er   th r u les  p r o v id ed   in   th p r o g r a m .   W h av d ev elo p ed   th is   al g o r ith m   u s in g   p y t h o n   b ased   f r a m e w o r k   ca lled   SC R A P Y.   T h is   alg o r ith m   p ar s es  th e   in f o r m atio n   p r esen i n   t h w e b s ite  an d   s a v t h d ata  i n to   d atab ase  an d   th er a f ter   w p er f o r m   an a l y s is   o n   th d ata  u s in g   a n   an a l y s is   s y s te m .   T h p r o g r a m   u s ed   to   p er f o r m   s cr ap p in g   i s   ca lled   as  S p id er   ( u s er - w r itte n   class es  u s ed   f o r   s cr ap p in g   in f o r m at io n ) .   Sp id er   g ets  th d ata  f r o m   th w eb s ites   b ased   o n   th d o m ai n ,   x p ath   an d   r u les  p r o v id ed   in   th p r o g r a m .   Fin al l y   cr o n j o b   is   w r it t en   f o r   o u r   p r o g r am   w h ic h   au t o m a ticall y   s tar ts   t h e   ex ec u t io n   o f   p r o g r a m   a n d   co llects d ata  d ail y   as p er   th ti m p r o v id ed   b y   th u s er .     Ou r   an a l y s is   s y s te m   is   w eb   m o d u le  d ev e lo p ed   u s i n g   h t m an d   J SP .   I p r o v id es  a n   in ter f a ce   f o r   o u r   d ata  to   an al y s e.   On ce   t h ad m i n   p er f o r m s   lo g i n   o p tio n s   li k ad d   r ec o r d s ,   m o d if y   r ec o r d s ,   v ie w   r ec o r d s   a n d   an al y s d ata  ap p ea r s   a n d   h c an   c h o o s an y   o p tio n   r eq u ir ed   b y   h i m .   T h is   s y s te m   p er f o r m   y ea r l y ,   m o n th l y ,   d ail y   an al y s is   o n   t h d ata   an d   m ak e s   o u r   w o r k   ea s ier   to   ca l cu late  C P I   an d   I n f latio n .   Vis u aliza tio n   o f   d ata  is   d o n u s in g   J f r ee c h ar lib r ar ies  av ai lab le  i n   j av a.   Usi n g   J f r ee ch ar ts   w ca n   d r a w   g r ap h s   f o r   o u r   d ata s et s   p r esen in   t h d atab ase.   Data s et  is   p ass ed   in to   th f u n ctio n   d r a w L i n eC h ar w h ic h   p lo th g r ap h s   an d   g e n er at e   th r esp o n s a s   an   i m ag e.   S i m ilar l y   w ca n   al s o   d r a w   co lu m n   ch ar ts   a n d   p ie  ch ar ts .       3 . 1 .   Alg o ri t h m   1 .     I m p o r t p ac k ag es r eq u ir ed   f o r   s cr ap in g .   2 .     C r ea te  class   w h ic h   ac ts   as a   co n tain er   f o r   all  th o b j ec ts .   3 .     P r o v id d etails o f   d o m ai n   f r o m   w h er d ata  to   b s cr ap p ed .   4 .     P r o v id u r l’ s   an d   r u le s   f o r   ex t r ac tio n .   5 .     Get  th x p at h s   f o r   all  th ele m en ts   to   b s cr ap p ed .   6 .     C all  p ar s f u n c tio n .   7 .     Get  co n n ec tio n   w it h   d atab ase.   8 .     P ip elin in g   d ata  in to   d atab ase.   9 .     R u n   s cr ap er .   1 0 .   Def in cr o n j o b   f o r   r u n n i n g   th p r o g r a m   i n   r eg u lar   i n ter v al.   Xp ath   is   p r o v id ed   to   th s p id er   in   th f o llo w in g   w a y :   Sp id er   is   p r o g r am   w h ic h   cr a w l in to   th w eb s ite  to   ex tr ac t d ata   # T h is   w ill cr ea te  lis t o f   p r o d u cts:            b u y er s   tr ee . x p a t h ( ' //d iv [ @ tit le= " P ro du ct - na m e " ] /tex t( ) ' )            # T h is   w ill cr ea te  lis t o f   p r ices            p r ices =   tr ee . x p ath ( ' / /s p an [ @ c lass =" P ro du ct - price " ] /tex t( ) )       4 .     RE SU L T S         Fig u r 1 .   Scr ap p ed   d ata  in   Scr ap y   Fra m e w o r k   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   2 2 5 2 - 8814   IJ AA S    Vo l.   4 ,   No .   4 Dec em b er   201 5   :   1 4 6     1 5 0   150       Fig u r 2 .   I n ter f ac f o r   P r ice  An al y s i s   S y s te m           Fig u r 3 .   Vis u al izatio n   o f   s cr ap p ed   d ata       5 .     CO NCLU SI O N   I n   th is   p ap er   w h a v p r o p o s ed   m o s e f f icie n tec h n iq u to   m i n t h co m m o d it y   p r ices   d ata  f r o m   w eb s i tes  a n d   p er f o r m   an al y s is   o n   t h e m .   T h is   tec h n iq u r eso lv es  al th p r o b le m s   p r o p o s ed   b y   p r ev io u s   au th o r s   o n   w eb   s cr ap in g .   W s u cc es s f u ll y   i m p le m e n ted   p r o g r a m   f o r   s cr ap p in g   d ata  f r o m   o n li n s to r es  an d   d esig n ed   s y s te m   w h ic h   p er f o r m   a n al y s i s   o n   th d ata.   T h e   s y s te m   p r o v id es  t h v is u aliz atio n   o f   d ata  i n   t h e   f o r m   o f   li n c h ar ts   an d   also   k e ep   tr ac k   o f   I n f la tio n   a n d   C o s P r ice  I n d ex   ( C P I )   o f   th co u n t r y .         RE F E R E NC E S   [1 ]   S tev e n   S .   S k ien a ,   T h e   A lg o rit h m   d e si g n   M a n u a l” ,   S e c o n d   Ed it i o n ,   S p ri n g e V e rlag   L o n d o n   L i m it e d ,   pp.   1 6 2 2 0 0 8 .   [2 ]   A le x a n d e S h e n ,   A lg o rit h m s an d   P ro g ra m m in g P ro b lem s an d   so lu ti o n s”   S e c o n d   e d i ti o n ,   S p ri n g e r ,   pp.   1 3 5 2 0 1 0 .   [3 ]   Na ra sin g h   De o ,   G ra p h   th e o ry   w i th   a p p li c a ti o n s to   e n g in e e rin g   a n d   c o m p u ter sc ien c e ,   HI pp.   3 0 1 2 0 0 4 .   [4 ]   Be n   Co p p i n ,   A rti f icia In telli g e n c e   il lu m in a ted ,   Jo n e s an d   Ba rlett   P u b li sh e rs,  pp.   77 2 0 0 4 .   [5 ]   S e rg e y   Brin   a n d   L a w re n c e   P a g e ,   An a t o my   o a   L a rg e   sc a le  Hy p e rte x tu a W e b   S e a rc h   E n g in e ,   P ro c .   W W c o n f e re n c e ,   2 0 0 4 .   [6 ]   Yo n g b in   Qi n   a n d   Da o y u n   Xu ,   A   B a lan c e d   Ra n k   A l g o rit h m   Ba s e d   o n   P a g e Ra n k   a n d   P a g e   Be li e f   re c o m m e n d a ti o n .   [7 ]   T I A Ch o n g ,   Kin d   o Al g o rith Fo Pa g e   Ra n k in g   Ba se d   o n   Cla ss if ied   T re e   In   S e a rc h   En g i n e ,   P r o c   In tern a ti o n a C o n f e re n c e   o n   Co m p u ter A p p li c a ti o n   a n d   S y ste m   M o d e li n g   (ICCA S M   2 0 1 0 ) ,   2 0 1 0 .   [8 ]   S .   N.  S iv a n a n d a m ,   S .   N.  De e p a ,   In tro d u c ti o n   to   G e n e ti c   A lg o rit h m s” ,   S p rin g e r,   p p .   20 2 0 0 8 .   [9 ]   S.   N.  P a lo d ,   Dr .   S.   K.   S h r iv a sta v ,   Dr .   P.   K.   P u r o h i t ,   Re v ie w   o f   G e n e ti c   A l g o rit h m   b a se d   f a c e   re c o g n it io n ,   In ter n a t io n a J o u rn a o E n g in e e rin g   S c ien c e   a n d   T e c h n o lo g y   ( IJ ES T ) ,   Vo l.   3 ,   N o .   2 ,   F e b   2 0 1 1 .   [1 0 ]   h tt p s:/ /www . k i m o n o lab s.co m   [1 1 ]   h tt p s:/ /i m p o rt. i o /   [1 2 ]   h tt p : // w e b sc ra p e r. io / a   [1 3 ]   V in e e t h   G .   Na ir ,   G e tt in g   S tarte d   w it h   Be a u ti f u S o u p ,   P a c k P u b l ish in g   L td .   Evaluation Warning : The document was created with Spire.PDF for Python.