Author |
Topic |
|
techdls
Starting Member
27 Posts |
Posted - 16 Aug 2012 : 22:28:12
|
I'm trying to scrape the metacritic score from IMDB but have been unsuccessful I would think something like this would work: (substituted for region)
--REGION------------------------------------------------------------------------------------ #REGION# #PUT#=0#00# #STARTREADWEB# #FINDLINE#=Metascore:#12##ONERROR#=*OK* #IF# #12#<>#00# #GOTO#=NOVOTES2 #ENDIF# #STARTREADWEB# #FINDLINE#=Metascore:#12##ONERROR#=*STOP* #FIND#=<a href="criticreviews">#12##ONERROR#=*STOP* #FIND#=>#11# #ONERROR#=*OK* #FIND#=<#12# #ONERROR#=*OK* #TAKEWORD#=#13#,#11#,#12# #TAKEREGION#=#13# :NOVOTES2 #ENDREGION#
I would expect it to come back with '79/100' etc. but no luck, I've also tried using other section's code but I'm really out of my element here. Any help would be appreciated. (I have been successful with getting the # of votes with the above but not the metacritic score). |
|
Prinz
Senior Member
Germany
1522 Posts |
Posted - 16 Aug 2012 : 22:40:14
|
That because you aren't in the correct line with:
#FINDLINE#=Metascore:#12##ONERROR#=*STOP*
And IMDB put even linebreaks in the middle of html tags sometimes. |
Edited by - Prinz on 16 Aug 2012 22:40:32 |
|
|
techdls
Starting Member
27 Posts |
Posted - 16 Aug 2012 : 22:52:19
|
Thank you for your response. That makes sense but I've also tried:
#FINDLINE#=<a href="criticreviews">#12##ONERROR#=*STOP*
or even the full line (which is unique for each movie because it has the number of reviews)
neither of which work. |
|
|
Prinz
Senior Member
Germany
1522 Posts |
Posted - 17 Aug 2012 : 13:44:06
|
It's working here:
--REGION------------------------------------------------------------------------------------
#REGION#
#PUT#=0#00#
#STARTREADWEB#
#FINDLINE#=<a href="criticreviews">#12##ONERROR#=*OK*
#IF# #12#==#00#
#GOTO#=NOVOTES2
#ENDIF#
#STARTREADWEB#
#FINDLINE#=<a href="criticreviews">#12##ONERROR#=*STOP*
#FIND#=<a href="criticreviews">#12##ONERROR#=*STOP*
#FIND#=>#11# #ONERROR#=*OK*
#FIND#=<#12# #ONERROR#=*OK*
#TAKEWORD#=#13#,#11#,#12#
#TAKEREGION#=#13#
:NOVOTES2
#ENDREGION# |
|
|
techdls
Starting Member
27 Posts |
Posted - 17 Aug 2012 : 20:06:05
|
Thank you so much Prinz. I have been banging my head against the wall trying to figure this out. Later I will post code for other fields I've successfully scraped for anyone who wants it. |
|
|
avathar
Starting Member
2 Posts |
Posted - 08 Aug 2014 : 04:03:42
|
Can someone please update this code because it is no longer working ? |
|
|
Sciolto
New Member
65 Posts |
Posted - 08 Nov 2014 : 11:12:57
|
I am still looking for some scripting manual to learn how to fix this properly but in the mean time I managed to make it work for me with section below:
--REGION------------------------------------------------------------------------------------ #REGION# #PUT#=0#00# #RESTOREMAIN# #STARTREADWEB# #FINDLINE#=Metacritic.com#12##ONERROR#=*OK* #IF# #12#==#00# #GOTO#=ENDTAKEREGION #ENDIF# #FIND#=Metacritic.com#11##ONERROR#=*STOP* #FIND#=>#11# #ONERROR#=*OK* #FIND#=/#12# #ONERROR#=*OK* #TAKEWORD#=#13#,#11#,#12# #TAKEREGION#=#13#
:ENDTAKEREGION #RESTOREMAIN# #ENDREGION#
|
|
|
Sciolto
New Member
65 Posts |
Posted - 08 Nov 2014 : 14:01:45
|
Looks like the same stuff can also be used to repair the section below:
--META CRITICS RATING------------------------------------------------------------------------------------ #REVIEWS# #PUT#=0#00# #RESTOREMAIN# #STARTREADWEB# #FINDLINE#=Metacritic.com#12##ONERROR#=*OK* #IF# #12#==#00# #GOTO#=ENDREVIEWS #ENDIF# #FIND#=Metacritic.com#11##ONERROR#=*STOP* #FIND#=>#11# #ONERROR#=*OK* #FIND#=/#12# #ONERROR#=*OK* #TAKEWORD#=#13#,#11#,#12# #FINDLINE#=Metacritic.com#12##ONERROR#=*OK* #IF# #12#==#00# #GOTO#=ENDREVIEWS #ENDIF# #FIND#=Metacritic.com#11##ONERROR#=*STOP* #COMPUTECURSOR#=+17 #PUTCURSOR#=#11# #COMPUTECURSOR#=+3 #PUTCURSOR#=#12# #TAKEWORD#=#14#,#11#,#12# #STRING#=#14#=Meta critics: #13#/100 (#14# critics) #TRIM# #TAKEREVIEW#=#14# :ENDREVIEWS #ENDREVIEWS#
|
|
|
avathar
Starting Member
2 Posts |
Posted - 27 Dec 2014 : 14:44:42
|
what version of EMM you are using, because i still have no luck with this code |
|
|
|
Topic |
|