How to use Beautiful Soup to extract function string in – jerry9855 Dec 06 '16 at 22:44

  • im trying to work it out, i'll edit this in a few minutes – roy Dec 06 '16 at 22:48
  • thank you for your help. is any way i can just get the "return" content under getData() function ? that is why I am trying to use regex. – jerry9855 Dec 06 '16 at 23:19
  • From what i know, bs isn't capable of that so you have other options like the one i wrote above. – roy Dec 06 '16 at 23:29
  • don't why. I still got the same error when i run your code. – jerry9855 Dec 06 '16 at 23:29
  • and this might be useful as well [link](http://stackoverflow.com/questions/25111752/extracting-text-using-beautifulsoup-in-python/25112034#25112034) – roy Dec 06 '16 at 23:31
  • print(script.text) AttributeError: 'NoneType' object has no attribute 'text' – jerry9855 Dec 06 '16 at 23:32
  • for some reason i still got the same error even I run you code. It was running correctly when you post the solution. do I need to do anything to re-run your code ? – jerry9855 Dec 06 '16 at 23:54
  • what version of python are you using? did you make sure bs and requests are up to date? can you double check which version of them you are using? also, instead of `print(script.text)`, do this : `print(soup.pretiffy())`, and post the results – roy Dec 07 '16 at 00:05
  • print(soup.pretiffy()) TypeError: 'NoneType' object is not callable – jerry9855 Dec 07 '16 at 02:52
  • my python version is 2.7.6 – jerry9855 Dec 07 '16 at 02:52
  • please `print(data)` and upload the result – roy Dec 07 '16 at 03:23
  • Well, this error indicates that "soup" == None, Did you try upgrade beautifulsoup and requests packages? If no, please do so as this error might be related to a version compatibility.. – roy Dec 07 '16 at 03:34
  • The issue was caused by network issue. They blocked my connection. Thank you for the help. – jerry9855 Dec 07 '16 at 06:40