1. javascriptのタグからアクセスしてきたユーザーにcookieをsetする (例えばFXのページ)
2. 別のページをアクセスした場合に、1でsetしたcookieを読み込んで、1に関連する広告を配信する
< async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></ >
<!-- auction -->
< class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-5909906903001543"
data-ad-slot="6431329951"></ins>
< >
(adsbygoogle = window.adsbygoogle || []).push({});
< >
まず、広告を出しているページが何のページか理解できないといけない。
pythonで解析できるようにしたい。
titleはbeautiful soupで解析する。
import requests, bs4
res = requests.get('http://hpscript.com/blog/')
res.raise_for_status()
soup = bs4.BeautifulSoup(res.text, "html.parser")
print(soup.title)
[vagrant@localhost app]$ python3 index.py
1. javascriptからpython fileにurlをpostしたい。
2. titleをpythonで形態素分析したい。
いけるか?