.net - How to get all the cookies issued by a webpage in c#? -
i want cookies issued page.
using chrome's developer tool, can see page issues adsense cookies. when try using httpwebrequest cant see these cookie using response.cookies.
example, visiting page: http://smallbiztrends.com/ can see there adsense cookies using developer tool cant access cookie using httpwebrequest...
does has solution this? doing wrong?
those cookies come several <iframe>
on html page served website.
if want cookies need fetch html , parse tags , load src
attributes.
do notice of these might require javascript run ... need functionality browser offers. simple webrequest not enough.
if you're going give try make sure create cookiecontainer
, set instance everytime request:
var cookies = new cookiecontainer(); webrequest req = webrequest.create(formurl); req.cookiecontainer = cookies; // lots of handling // next request req = webrequest.create(formurl); req.cookiecontainer = cookies; // reuse cookies
Comments
Post a Comment