Sunday 15 January 2012

how to grab from JSON in selenium python -



how to grab from JSON in selenium python -

my page returns json http response contains id: 14

is there way in selenium python grab this? searched web , not find solutions. wondering maybe not possible? grab id db trying avoid this. please tell me if there ways around. give thanks you

you can utilize beautifulsoup parse page , extract json. code need should this. may need alter soup.find command if json isn't straight in body of response.

from bs4 import beautifulsoup import json soup = beautifulsoup(driver.page_source) dict_from_json = json.loads(soup.find("body").text)

python json selenium

No comments:

Post a Comment