<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Python - イチゾーのブログ</title>
	<atom:link href="https://ichizo.biz/category/python/feed" rel="self" type="application/rss+xml" />
	<link>https://ichizo.biz</link>
	<description>システム開発やWordPressについてなど</description>
	<lastBuildDate>Wed, 18 Jan 2017 09:10:05 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
<site xmlns="com-wordpress:feed-additions:1">120380898</site>	<item>
		<title>Spyderをアップデートしたらすぐに新しいアップデートが来たので再度アップデート</title>
		<link>https://ichizo.biz/2017/01/18/update-spyder-2.html</link>
					<comments>https://ichizo.biz/2017/01/18/update-spyder-2.html?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[一蔵]]></dc:creator>
		<pubDate>Wed, 18 Jan 2017 09:10:05 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Anaconda]]></category>
		<category><![CDATA[Spyder]]></category>
		<guid isPermaLink="false">http://ichizo.biz/?p=120</guid>

					<description><![CDATA[<p>PythonのIDE「Spyder」をアップデートついでにA [&#8230;]</p>
<p>The post <a href="https://ichizo.biz/2017/01/18/update-spyder-2.html">Spyderをアップデートしたらすぐに新しいアップデートが来たので再度アップデート</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><a href="http://ichizo.biz/2017/01/18/update-spyder.html">PythonのIDE「Spyder」をアップデートついでにAnacondaも</a>で<br />
Spyderをアップデートしました。</p>
<p>これで度々出ていたバージョン3.0.2にアップデートできました。</p>
<p>で、再度Spyderを立ち上げると、また出たのです。<br />
アップデート通知ウィンドウが。</p>
<p><a href="http://ichizo.biz/wp-content/uploads/2017/01/04アップデート通知.png"><img fetchpriority="high" decoding="async" data-attachment-id="121" data-permalink="https://ichizo.biz/2017/01/18/update-spyder-2.html/04%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88%e9%80%9a%e7%9f%a5" data-orig-file="https://ichizo.biz/wp-content/uploads/2017/01/04アップデート通知.png" data-orig-size="502,240" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="04Spyderアップデート通知" data-image-description="" data-image-caption="" data-medium-file="https://ichizo.biz/wp-content/uploads/2017/01/04アップデート通知-300x143.png" data-large-file="https://ichizo.biz/wp-content/uploads/2017/01/04アップデート通知.png" src="http://ichizo.biz/wp-content/uploads/2017/01/04アップデート通知.png" alt="" width="502" height="240" class="alignnone size-full wp-image-121" srcset="https://ichizo.biz/wp-content/uploads/2017/01/04アップデート通知.png 502w, https://ichizo.biz/wp-content/uploads/2017/01/04アップデート通知-300x143.png 300w" sizes="(max-width: 502px) 100vw, 502px" /></a></p>
<p>今度は、「Releases」のリンクをクリックするとWEBページが開きます。</p>
<p>そこには、アップデートの方法が書かれています。</p>
<pre class="lang:python decode:true " >
conda update qt pyqt
conda update spyder
</pre>
<p>Spyderを一旦閉じて、上記のコマンドを実行します。</p>
<pre class="lang:python decode:true " >
&gt;conda update qt pyqt
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at e:\Anaconda3:
#


&gt;
</pre>
<p>qt、pyqtについてはアップデートはないようです。</p>
<p>（さっきアップデートしたばっかりですから）</p>
<p>Spyderのアップデートを実行します。</p>
<pre class="lang:python decode:true " >
&gt;conda update spyder
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at e:\Anaconda3:
#
spyder                    3.0.2                    py35_0

&gt;</pre>
<p>ん？アップデートない？</p>
<p>pipでやってみます。</p>
<pre class="lang:python decode:true " >
&gt;pip install -U spyder
Collecting spyder
  Downloading spyder-3.1.0-py3-none-any.whl (3.4MB)
    100% |################################| 3.4MB 92kB/s
Collecting numpydoc (from spyder)
  Downloading numpydoc-0.6.0.tar.gz
Requirement already up-to-date: qtawesome&gt;=0.4.1 in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: chardet&gt;=2.0.0 in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: pickleshare in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: sphinx in e:\anaconda3\lib\site-packages\sphinx-1.5.1-py3.5.egg (from spyder)
Requirement already up-to-date: jedi in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: qtconsole&gt;=4.2.0 in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: qtpy&gt;=1.1.0 in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: pylint in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: psutil in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: rope-py3k in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: pyzmq in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: nbconvert in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: pygments&gt;=2.0 in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: pyflakes in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: pep8 in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: six in e:\anaconda3\lib\site-packages (from qtawesome&gt;=0.4.1-&gt;spyder)
Requirement already up-to-date: Jinja2&gt;=2.3 in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Requirement already up-to-date: docutils&gt;=0.11 in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Requirement already up-to-date: snowballstemmer&gt;=1.1 in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Requirement already up-to-date: babel!=2.0,&gt;=1.3 in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Requirement already up-to-date: alabaster&lt;0.8,&gt;=0.7 in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Requirement already up-to-date: imagesize in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Requirement already up-to-date: requests in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Requirement already up-to-date: colorama&gt;=0.3.5 in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Requirement already up-to-date: bleach in e:\anaconda3\lib\site-packages (from nbconvert-&gt;spyder)
Requirement already up-to-date: testpath in e:\anaconda3\lib\site-packages (from nbconvert-&gt;spyder)
Requirement already up-to-date: mistune!=0.6 in e:\anaconda3\lib\site-packages (from nbconvert-&gt;spyder)
Requirement already up-to-date: entrypoints&gt;=0.2.2 in e:\anaconda3\lib\site-packages (from nbconvert-&gt;spyder)
Requirement already up-to-date: traitlets&gt;=4.2 in e:\anaconda3\lib\site-packages (from nbconvert-&gt;spyder)
Requirement already up-to-date: nbformat in e:\anaconda3\lib\site-packages (from nbconvert-&gt;spyder)
Requirement already up-to-date: pandocfilters&gt;=1.4.1 in e:\anaconda3\lib\site-packages (from nbconvert-&gt;spyder)
Requirement already up-to-date: jupyter-core in e:\anaconda3\lib\site-packages (from nbconvert-&gt;spyder)
Requirement already up-to-date: MarkupSafe&gt;=0.23 in e:\anaconda3\lib\site-packages (from Jinja2&gt;=2.3-&gt;sphinx-&gt;spyder)
Requirement already up-to-date: pytz&gt;=0a in e:\anaconda3\lib\site-packages (from babel!=2.0,&gt;=1.3-&gt;sphinx-&gt;spyder)
Requirement already up-to-date: html5lib!=0.9999,!=0.99999,&lt;0.99999999,&gt;=0.999 in e:\anaconda3\lib\site-packages (from bleach-&gt;nbconvert-&gt;spyder)
Building wheels for collected packages: numpydoc
  Running setup.py bdist_wheel for numpydoc ... done
  Stored in directory: C:\Users\hoge\AppData\Local\pip\Cache\wheels\9d\ca\8c\9be286b195791bbbfebfd407899de13eb12725a2c2c9fdb36f
Successfully built numpydoc
Installing collected packages: numpydoc, spyder
  Found existing installation: spyder 3.0.2
    DEPRECATION: Uninstalling a distutils installed project (spyder) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling spyder-3.0.2:
      Successfully uninstalled spyder-3.0.2
Successfully installed numpydoc-0.6.0 spyder-3.1.0

&gt;
</pre>
<p>Spyderの3.1.0 来ました。</p>
<p><a href="http://ichizo.biz/wp-content/uploads/2017/01/05Spyderについて_バージョンアップ成功.png"><img decoding="async" data-attachment-id="122" data-permalink="https://ichizo.biz/2017/01/18/update-spyder-2.html/05spyder%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6_%e3%83%90%e3%83%bc%e3%82%b8%e3%83%a7%e3%83%b3%e3%82%a2%e3%83%83%e3%83%97%e6%88%90%e5%8a%9f" data-orig-file="https://ichizo.biz/wp-content/uploads/2017/01/05Spyderについて_バージョンアップ成功.png" data-orig-size="502,407" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Spyderについて_バージョンアップ成功" data-image-description="" data-image-caption="" data-medium-file="https://ichizo.biz/wp-content/uploads/2017/01/05Spyderについて_バージョンアップ成功-300x243.png" data-large-file="https://ichizo.biz/wp-content/uploads/2017/01/05Spyderについて_バージョンアップ成功.png" src="http://ichizo.biz/wp-content/uploads/2017/01/05Spyderについて_バージョンアップ成功.png" alt="" width="502" height="407" class="alignnone size-full wp-image-122" srcset="https://ichizo.biz/wp-content/uploads/2017/01/05Spyderについて_バージョンアップ成功.png 502w, https://ichizo.biz/wp-content/uploads/2017/01/05Spyderについて_バージョンアップ成功-300x243.png 300w" sizes="(max-width: 502px) 100vw, 502px" /></a></p><p>The post <a href="https://ichizo.biz/2017/01/18/update-spyder-2.html">Spyderをアップデートしたらすぐに新しいアップデートが来たので再度アップデート</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://ichizo.biz/2017/01/18/update-spyder-2.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">120</post-id>	</item>
		<item>
		<title>PythonのIDE「Spyder」をアップデートついでにAnacondaも</title>
		<link>https://ichizo.biz/2017/01/18/update-spyder.html</link>
					<comments>https://ichizo.biz/2017/01/18/update-spyder.html?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[一蔵]]></dc:creator>
		<pubDate>Wed, 18 Jan 2017 07:54:52 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Anaconda]]></category>
		<category><![CDATA[Spyder]]></category>
		<guid isPermaLink="false">http://ichizo.biz/?p=111</guid>

					<description><![CDATA[<p>非常に重宝しているPythonのパッケージであるAnacon [&#8230;]</p>
<p>The post <a href="https://ichizo.biz/2017/01/18/update-spyder.html">PythonのIDE「Spyder」をアップデートついでにAnacondaも</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>非常に重宝しているPythonのパッケージであるAnacondaに同梱されている<br />
Spyderを開発環境として利用させてもらっています。</p>
<p>作成しているプログラムがWEBアプリとかではなく<br />
スクリプトで実行させるものなので<br />
Spyderはコーディングと実行が手軽にできて<br />
便利に使用しています。</p>
<p>そのSpyderですが、アップデート通知が表示されます。<br />
こんなやつです。<br />
<a href="http://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知.png"><img decoding="async" data-attachment-id="112" data-permalink="https://ichizo.biz/2017/01/18/update-spyder.html/01%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88%e9%80%9a%e7%9f%a5" data-orig-file="https://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知.png" data-orig-size="502,203" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Spyderアップデート通知" data-image-description="" data-image-caption="" data-medium-file="https://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知-300x121.png" data-large-file="https://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知.png" src="http://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知.png" alt="" width="502" height="203" class="alignnone size-full wp-image-112" srcset="https://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知.png 502w, https://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知-300x121.png 300w" sizes="(max-width: 502px) 100vw, 502px" /></a></p>
<p>「Releases」とか「Installation」とかのリンクをクリックしてみても何も起きません。<br />
「OK」ボタンも反応しません。</p>
<p>仕方がないので右上の「×」ボタンで閉じるのですが、<br />
よく使うSpyderなので、バージョンアップしておこうと思ったので、<br />
バージョンアップ方法をメモしておきます。</p>
<p>まず、Spyderを開いている場合、念のため閉じておきます。</p>
<p>アップデートは、コマンドプロンプトを開いて以下のコマンドを実行します。</p>
<pre class="lang:python decode:true " >
pip install --upgrade spyder
</pre>
<p>アップデートが実行されます。<br />
私のパソコンは低スペックのためか、結構時間がかかりました。</p>
<pre class="lang:python decode:true " >
&gt;pip install --upgrade spyder
Collecting spyder
  Downloading spyder-3.0.2-py3-none-any.whl (3.4MB)
    100% |################################| 3.4MB 92kB/s
Collecting qtawesome (from spyder)
  Downloading QtAwesome-0.4.1-py2.py3-none-any.whl (150kB)
    100% |################################| 153kB 480kB/s
Collecting nbconvert (from spyder)
  Downloading nbconvert-5.0.0-py2.py3-none-any.whl (371kB)
    100% |################################| 378kB 239kB/s
Collecting pyzmq (from spyder)
  Downloading pyzmq-16.0.2-cp35-cp35m-win_amd64.whl (917kB)
    100% |################################| 921kB 135kB/s
Collecting psutil (from spyder)
  Downloading psutil-5.0.1-cp35-cp35m-win_amd64.whl (181kB)
    100% |################################| 184kB 211kB/s
Requirement already up-to-date: pickleshare in e:\anaconda3\lib\site-packages (from spyder)
Collecting sphinx (from spyder)
  Downloading Sphinx-1.5.1-py2.py3-none-any.whl (1.6MB)
    100% |################################| 1.6MB 167kB/s
Requirement already up-to-date: rope-py3k in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: jedi in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: pygments&gt;=2.0 in e:\anaconda3\lib\site-packages (from spyder)
Collecting pyflakes (from spyder)
  Downloading pyflakes-1.5.0-py2.py3-none-any.whl (225kB)
    100% |################################| 225kB 361kB/s
Collecting pylint (from spyder)
  Downloading pylint-1.6.4-py2.py3-none-any.whl (569kB)
    100% |################################| 573kB 288kB/s
Collecting qtpy&gt;=1.1.0 (from spyder)
  Downloading QtPy-1.2.0-py2.py3-none-any.whl
Requirement already up-to-date: qtconsole&gt;=4.2.0 in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: pep8 in e:\anaconda3\lib\site-packages (from spyder)
Requirement already up-to-date: six in e:\anaconda3\lib\site-packages (from qtawesome-&gt;spyder)
Collecting nbformat (from nbconvert-&gt;spyder)
  Downloading nbformat-4.2.0-py2.py3-none-any.whl (153kB)
    100% |################################| 153kB 446kB/s
Collecting pandocfilters&gt;=1.4.1 (from nbconvert-&gt;spyder)
  Downloading pandocfilters-1.4.1.tar.gz
Collecting jinja2 (from nbconvert-&gt;spyder)
  Downloading Jinja2-2.9.4-py2.py3-none-any.whl (274kB)
    100% |################################| 276kB 371kB/s
Collecting traitlets&gt;=4.2 (from nbconvert-&gt;spyder)
  Downloading traitlets-4.3.1-py2.py3-none-any.whl (74kB)
    100% |################################| 81kB 441kB/s
Collecting jupyter-core (from nbconvert-&gt;spyder)
  Downloading jupyter_core-4.2.1-py2.py3-none-any.whl (125kB)
    100% |################################| 133kB 382kB/s
Collecting testpath (from nbconvert-&gt;spyder)
  Downloading testpath-0.3-py2.py3-none-any.whl (82kB)
    100% |################################| 92kB 395kB/s
Requirement already up-to-date: mistune!=0.6 in e:\anaconda3\lib\site-packages (from nbconvert-&gt;spyder)
Collecting bleach (from nbconvert-&gt;spyder)
  Downloading bleach-1.5.0-py2.py3-none-any.whl
Collecting entrypoints&gt;=0.2.2 (from nbconvert-&gt;spyder)
  Downloading entrypoints-0.2.2-py2.py3-none-any.whl
Collecting docutils&gt;=0.11 (from sphinx-&gt;spyder)
  Downloading docutils-0.13.1-py3-none-any.whl (536kB)
    100% |################################| 542kB 281kB/s
Requirement already up-to-date: imagesize in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Requirement already up-to-date: colorama&gt;=0.3.5; sys_platform == "win32" in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Requirement already up-to-date: babel!=2.0,&gt;=1.3 in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Collecting requests (from sphinx-&gt;spyder)
  Downloading requests-2.12.4-py2.py3-none-any.whl (576kB)
    100% |################################| 583kB 204kB/s
Requirement already up-to-date: alabaster&lt;0.8,&gt;=0.7 in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Requirement already up-to-date: snowballstemmer&gt;=1.1 in e:\anaconda3\lib\site-packages (from sphinx-&gt;spyder)
Collecting mccabe (from pylint-&gt;spyder)
  Downloading mccabe-0.5.3-py2.py3-none-any.whl
Collecting astroid&lt;1.5.0,&gt;=1.4.5 (from pylint-&gt;spyder)
  Downloading astroid-1.4.9-py2.py3-none-any.whl (213kB)
    100% |################################| 215kB 220kB/s
Collecting isort&gt;=4.2.5 (from pylint-&gt;spyder)
  Downloading isort-4.2.5-py2.py3-none-any.whl (40kB)
    100% |################################| 40kB 372kB/s
Requirement already up-to-date: jsonschema!=2.5.0,&gt;=2.4 in e:\anaconda3\lib\site-packages (from nbformat-&gt;nbconvert-&gt;spyder)
Requirement already up-to-date: ipython-genutils in e:\anaconda3\lib\site-packages (from nbformat-&gt;nbconvert-&gt;spyder)
Requirement already up-to-date: MarkupSafe&gt;=0.23 in e:\anaconda3\lib\site-packages (from jinja2-&gt;nbconvert-&gt;spyder)
Collecting decorator (from traitlets&gt;=4.2-&gt;nbconvert-&gt;spyder)
  Downloading decorator-4.0.11-py2.py3-none-any.whl
Collecting html5lib!=0.9999,!=0.99999,&lt;0.99999999,&gt;=0.999 (from bleach-&gt;nbconvert-&gt;spyder)
  Downloading html5lib-0.9999999.tar.gz (889kB)
    100% |################################| 890kB 146kB/s
Collecting pytz&gt;=0a (from babel!=2.0,&gt;=1.3-&gt;sphinx-&gt;spyder)
  Downloading pytz-2016.10-py2.py3-none-any.whl (483kB)
    100% |################################| 491kB 199kB/s
Collecting lazy-object-proxy (from astroid&lt;1.5.0,&gt;=1.4.5-&gt;pylint-&gt;spyder)
  Downloading lazy_object_proxy-1.2.2-cp35-cp35m-win_amd64.whl
Collecting wrapt (from astroid&lt;1.5.0,&gt;=1.4.5-&gt;pylint-&gt;spyder)
  Downloading wrapt-1.10.8.tar.gz
Building wheels for collected packages: pandocfilters, html5lib, wrapt
  Running setup.py bdist_wheel for pandocfilters ... done
  Stored in directory: C:\Users\hoge\AppData\Local\pip\Cache\wheels\d4\01\68\49055c80b9f01ccb49241e73c8019628605064730941d70b56
  Running setup.py bdist_wheel for html5lib ... done
  Stored in directory: C:\Users\hoge\AppData\Local\pip\Cache\wheels\6f\85\6c\56b8e1292c6214c4eb73b9dda50f53e8e977bf65989373c962
  Running setup.py bdist_wheel for wrapt ... done
  Stored in directory: C:\Users\hoge\AppData\Local\pip\Cache\wheels\19\8a\01\20cf74c3f38d49ef8e9b9aa7ffd38cefff79bad9f6f2c651f0
Successfully built pandocfilters html5lib wrapt
Installing collected packages: qtpy, qtawesome, decorator, traitlets, jupyter-core, nbformat, pandocfilters, jinja2, testpath, html5lib, bleach, entrypoints, nbconvert, pyzmq, psutil, docutils, requests, sphinx, pyflakes, mccabe, lazy-object-proxy, wrapt, astroid, isort, pylint, spyder, pytz
  Found existing installation: QtPy 1.1.2
    Uninstalling QtPy-1.1.2:
      Successfully uninstalled QtPy-1.1.2
  Found existing installation: QtAwesome 0.3.3
    Uninstalling QtAwesome-0.3.3:
      Successfully uninstalled QtAwesome-0.3.3
  Found existing installation: decorator 4.0.10
    Uninstalling decorator-4.0.10:
      Successfully uninstalled decorator-4.0.10
  Found existing installation: traitlets 4.3.0
    DEPRECATION: Uninstalling a distutils installed project (traitlets) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling traitlets-4.3.0:
      Successfully uninstalled traitlets-4.3.0
  Found existing installation: jupyter-core 4.2.0
    DEPRECATION: Uninstalling a distutils installed project (jupyter-core) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling jupyter-core-4.2.0:
      Successfully uninstalled jupyter-core-4.2.0
  Found existing installation: nbformat 4.1.0
    DEPRECATION: Uninstalling a distutils installed project (nbformat) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling nbformat-4.1.0:
      Successfully uninstalled nbformat-4.1.0
  Found existing installation: Jinja2 2.8
    Uninstalling Jinja2-2.8:
      Successfully uninstalled Jinja2-2.8
  Found existing installation: nbconvert 4.2.0
    DEPRECATION: Uninstalling a distutils installed project (nbconvert) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling nbconvert-4.2.0:
      Successfully uninstalled nbconvert-4.2.0
  Found existing installation: pyzmq 15.4.0
    DEPRECATION: Uninstalling a distutils installed project (pyzmq) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling pyzmq-15.4.0:
      Successfully uninstalled pyzmq-15.4.0
  Found existing installation: psutil 4.3.1
    DEPRECATION: Uninstalling a distutils installed project (psutil) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling psutil-4.3.1:
      Successfully uninstalled psutil-4.3.1
  Found existing installation: docutils 0.12
    DEPRECATION: Uninstalling a distutils installed project (docutils) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling docutils-0.12:
      Successfully uninstalled docutils-0.12
  Found existing installation: requests 2.11.1
    Uninstalling requests-2.11.1:
      Successfully uninstalled requests-2.11.1
  Found existing installation: sphinx 1.4.6
Cannot remove entries from nonexistent file e:\anaconda3\lib\site-packages\easy-install.pth

&gt;
</pre>
<p>アップデート完了後、Spyderを立ち上げます。</p>
<p>あれ、まだ表示される・・・。<br />
<a href="http://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知.png"><img decoding="async" data-attachment-id="112" data-permalink="https://ichizo.biz/2017/01/18/update-spyder.html/01%e3%82%a2%e3%83%83%e3%83%97%e3%83%87%e3%83%bc%e3%83%88%e9%80%9a%e7%9f%a5" data-orig-file="https://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知.png" data-orig-size="502,203" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="Spyderアップデート通知" data-image-description="" data-image-caption="" data-medium-file="https://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知-300x121.png" data-large-file="https://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知.png" src="http://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知.png" alt="" width="502" height="203" class="alignnone size-full wp-image-112" srcset="https://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知.png 502w, https://ichizo.biz/wp-content/uploads/2017/01/01アップデート通知-300x121.png 300w" sizes="(max-width: 502px) 100vw, 502px" /></a></p>
<p>バージョンを表記させると、変わっていない・・・。<br />
<a href="http://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて.png"><img loading="lazy" decoding="async" data-attachment-id="113" data-permalink="https://ichizo.biz/2017/01/18/update-spyder.html/02spyder%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6" data-orig-file="https://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて.png" data-orig-size="502,407" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="02Spyderについて" data-image-description="" data-image-caption="" data-medium-file="https://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて-300x243.png" data-large-file="https://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて.png" src="http://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて.png" alt="" width="502" height="407" class="alignnone size-full wp-image-113" srcset="https://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて.png 502w, https://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて-300x243.png 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a></p>
<p>調べてみると、Spyder単体のみではなく、<br />
<a href="http://mumu.jpn.ph/forest/computer/2016/03/10/2761/" target="_blank">Anacondaそのものをアップデートする</a>というものがありました。</p>
<p>やってみます。</p>
<pre class="lang:python decode:true " >
&gt;conda update conda
Fetching package metadata .........
Solving package specifications: ..........

Package plan for installation in environment e:\Anaconda3:

The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    conda-env-2.6.0            |                0          498 B
    requests-2.12.4            |           py35_0         791 KB
    pyopenssl-16.2.0           |           py35_0          70 KB
    conda-4.3.4                |           py35_0         534 KB
    ------------------------------------------------------------
                                           Total:         1.4 MB

The following NEW packages will be INSTALLED:

    conda-env: 2.6.0-0

The following packages will be UPDATED:

    conda:     4.2.9-py35_0  --&gt; 4.3.4-py35_0
    pyopenssl: 16.0.0-py35_0 --&gt; 16.2.0-py35_0
    requests:  2.11.1-py35_0 --&gt; 2.12.4-py35_0

Proceed ([y]/n)? y

Fetching packages ...
conda-env-2.6. 100% |###############################| Time: 0:00:00  99.39 kB/s
requests-2.12. 100% |###############################| Time: 0:00:00   1.40 MB/s
pyopenssl-16.2 100% |###############################| Time: 0:00:00   1.84 MB/s
conda-4.3.4-py 100% |###############################| Time: 0:00:00   1.45 MB/s
Extracting packages ...
[      COMPLETE      ]|##################################################| 100%
Unlinking packages ...
[      COMPLETE      ]|##################################################| 100%
Linking packages ...
[      COMPLETE      ]|##################################################| 100%

&gt;
</pre>
<p>これでも変わりません・・・。<br />
<a href="http://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて.png"><img loading="lazy" decoding="async" data-attachment-id="113" data-permalink="https://ichizo.biz/2017/01/18/update-spyder.html/02spyder%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6" data-orig-file="https://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて.png" data-orig-size="502,407" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="02Spyderについて" data-image-description="" data-image-caption="" data-medium-file="https://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて-300x243.png" data-large-file="https://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて.png" src="http://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて.png" alt="" width="502" height="407" class="alignnone size-full wp-image-113" srcset="https://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて.png 502w, https://ichizo.biz/wp-content/uploads/2017/01/02Spyderについて-300x243.png 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a></p>
<p>パッケージ一式のアップデートがあったので、今度はこれをやってみます。</p>
<pre class="lang:python decode:true " >
&gt;conda update --all
</pre>
<p>何度か以下のメッセージを出して止まりました。</p>
<pre class="lang:python decode:true " >
WARNING conda.gateways.disk:exp_backoff_fn(47): Uncaught backoff with errno 41
</pre>
<p>どうもリトライしろということのようなので、<br />
何度か実行していると大丈夫そうなメッセージが返ってきました。</p>
<pre class="lang:python decode:true " >
&gt;conda update --all
Fetching package metadata ...........
Solving package specifications: .

# All requested packages already installed.
# packages in environment at e:\Anaconda3:
#


&gt;
</pre>
<p>Syderのバージョンを確認してみると、無事にバージョンアップされていました。</p>
<p><a href="http://ichizo.biz/wp-content/uploads/2017/01/03Spyderについて_バージョンアップ成功.png"><img loading="lazy" decoding="async" data-attachment-id="114" data-permalink="https://ichizo.biz/2017/01/18/update-spyder.html/03spyder%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6_%e3%83%90%e3%83%bc%e3%82%b8%e3%83%a7%e3%83%b3%e3%82%a2%e3%83%83%e3%83%97%e6%88%90%e5%8a%9f" data-orig-file="https://ichizo.biz/wp-content/uploads/2017/01/03Spyderについて_バージョンアップ成功.png" data-orig-size="502,407" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}" data-image-title="03Spyderについて_バージョンアップ成功" data-image-description="" data-image-caption="" data-medium-file="https://ichizo.biz/wp-content/uploads/2017/01/03Spyderについて_バージョンアップ成功-300x243.png" data-large-file="https://ichizo.biz/wp-content/uploads/2017/01/03Spyderについて_バージョンアップ成功.png" src="http://ichizo.biz/wp-content/uploads/2017/01/03Spyderについて_バージョンアップ成功.png" alt="" width="502" height="407" class="alignnone size-full wp-image-114" srcset="https://ichizo.biz/wp-content/uploads/2017/01/03Spyderについて_バージョンアップ成功.png 502w, https://ichizo.biz/wp-content/uploads/2017/01/03Spyderについて_バージョンアップ成功-300x243.png 300w" sizes="auto, (max-width: 502px) 100vw, 502px" /></a></p><p>The post <a href="https://ichizo.biz/2017/01/18/update-spyder.html">PythonのIDE「Spyder」をアップデートついでにAnacondaも</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://ichizo.biz/2017/01/18/update-spyder.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">111</post-id>	</item>
		<item>
		<title>PythonでAmazon Product Advertising APIを呼び出してKindle Unlimitedの情報を取得する</title>
		<link>https://ichizo.biz/2016/12/29/kindle-unlimited.html</link>
					<comments>https://ichizo.biz/2016/12/29/kindle-unlimited.html?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[一蔵]]></dc:creator>
		<pubDate>Thu, 29 Dec 2016 08:25:19 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[英語]]></category>
		<category><![CDATA[Amazon Product Advertising API]]></category>
		<category><![CDATA[英語多読]]></category>
		<guid isPermaLink="false">http://ichizo.biz/?p=100</guid>

					<description><![CDATA[<p>「英語多読用の本をレベル別に取得する（完成版）」で、 英語多 [&#8230;]</p>
<p>The post <a href="https://ichizo.biz/2016/12/29/kindle-unlimited.html">PythonでAmazon Product Advertising APIを呼び出してKindle Unlimitedの情報を取得する</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>「<a href="http://ichizo.biz/2016/12/29/python-selenium-3.html">英語多読用の本をレベル別に取得する（完成版）</a>」で、<br />
英語多読用の本のISBNリストを取得しました。</p>
<p>今度はこれを使用して、Amazon Product Advertising APIを呼び出してKindle Unlimitedの情報を取得するということをやります。</p>
<h2>目的：英語多読をKindle Unlimitedでやりたい</h2>
<p>英語力を伸ばしたいということで、英語多読をやってみたいのですが、<br />
多読用の本を買っていては高くついてしまうというネックがあります。</p>
<p><a href="https://www.seg.co.jp/sss/learning/sss-for-low-intermeidate.html" target="_blank">英語多読研究会さんのHP</a>に、難易度別の類型読書語数の目安が掲載されています。</p>
<p>それによると、各レベルごとの累計語数は以下のようになっています。</p>
<pre>
Level0　　 30,000語
Level1　　120,000語
Level2　　470,000語
Level3　1,020,000語
Level4　1,320,000語
Level5　1,600,000語
Level6　1,900,000語
Level7　2,000,000語
Level8　2,200,000語
Level9　2,380,000語
</pre>
<p>これを達成するためには、各レベルで以下の冊数が必要になります。</p>
<pre>
Level0　30冊
Level1　30冊
Level2　50冊
Level3　50冊
Level4　15冊
Level5　10冊
Level6　10冊
Level7　2冊
Level8　2冊
Level9　1冊
</pre>
<p>Level0では、3万語の読書語数が推奨されていますが、<br />
これを満たすためには大体30冊読まなければいけないという計算になります。</p>
<p>Level9では、読書語数は18万語となっていますが、<br />
読むべき冊数は1冊です。</p>
<p>これは、難易度があがると1冊あたりの語数が増えるため、<br />
読む必要がある冊数は減ってくるということですね。</p>
<p>英語多読を始めたばかりの難易度の低い頃に読むのが<br />
語数が少なく読みやすい本（児童向けだったりします）になりますので、<br />
必然的に読むべき冊数が増えてしまいます。</p>
<p>１冊あたり500円とか600円とかなので、決して高いわけではありませんが、<br />
Level0で30冊、Level1で30冊、Level2で50冊・・・<br />
となると、一人で揃えるには予算的に非常に厳しいものがあります。</p>
<p>そこで、読み放題のKindle Unlimitedを英語多読に使えないかと考えた訳です。</p>
<p>英語多読研究会さんでは、<a href="http://www.seg.co.jp/sss_review/jsp/frm_a_100.jsp" target="_blank">多読用の洋書のリストを難易度別に公開されています</a>ので、<br />
ここで公開されている本のリストから、Kindle Unlimitedに登録されているものを探し出すということをやってみます。</p>
<p>多読用の本のリスト取得は<a href="http://ichizo.biz/2016/12/29/python-selenium-3.html">前回</a>までに行っていますので、<br />
今回は取得したリストを元にAmazon Product Advertising APIを呼び出して本の情報を取得するということをやってみます。</p>
<p>ソースコード</p>
<pre class="lang:python decode:true " title="amazon_api.py" >
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 19 14:49:19 2016

@author: 
"""

from bottlenose import api
from lxml import objectify
import time

AMAZON_ACCESS_KEY_ID = "アクセスキー"
AMAZON_SECRET_KEY = "シークレットキー"
AMAZON_ASSOC_TAG = "アソシエイトタグ"

KINDLE_UMLIMITED_NODE_ID = "4486610051"

amazon = api.Amazon(AMAZON_ACCESS_KEY_ID, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG, Region = "JP")

def file_read (file):
    f = open(file, 'r')
    data = f.read()
    f.close()
    lines = data.split('\n')
    return lines

def loop_min(max_level):
    book_list = []
    min_level = 0
    while min_level &lt; 1:
        level = max_level + min_level
        print('list'+str('%1.1f' % level)+'.txt')
        lines = file_read('list'+str('%1.1f' % level)+'.txt')
        for line in lines:
            if (len(line) &gt; 0):
                print('line='+line)
                items = item_search(line)
                item_find = items.find('Item')
                if (item_find is not None):
                    for item in item_find:
                        if (item is not None):
                            title = item.ItemAttributes.Title
                            author = item.ItemAttributes.Author
                            isbn = item.ItemAttributes.Isbn
                            url = item.DetailPageURL
                            print(("%s, %s, %s, %s, %s" % (line, title, author, isbn, url)))
                            book_list.append(str("%s, %s, %s, %s, %s" % (line, title, author, isbn, url)))
                        else:
                            print ("%s : Book is None" % (line))
                #print ("END %s" % (line))
                time.sleep(5)   # Amazon API呼び出しは1秒に1回以内に収めるためsleep

        min_level += 0.1
        
    return book_list
    
def loop_max():
    max_level = 0
    while max_level &lt; 10:
        book_list = loop_min(max_level)
        write_file(book_list, max_level)
        max_level += 1
    
def write_file(book_list, max_level):
    f = open('amazon'+str('%1d' % max_level)+'.txt', 'w')
    for book in book_list:
        f.write(book)
        f.write('\n')
    f.close()

def item_search (keywords, searchIndex="KindleStore", browseNode=KINDLE_UMLIMITED_NODE_ID):
    response = amazon.ItemSearch(Keywords=keywords, SearchIndex=searchIndex, BrowseNode=browseNode, ResponseGroup="Large")
    root = objectify.fromstring(response)
    return root.Items

if __name__ == '__main__':
    
        loop_max()
</pre>
<p>bottlenoseを使ってAmazon Product Advertising APIを呼び出しています。</p>
<p>この使い方は<a href="http://ichizo.biz/2016/12/20/english-kindle-unlimited.html">以前の記事</a>を参考にしてください。</p>
<p>今回やっていることは、ISBNのリストファイルを開き１行ずつAmazon Product Advertising APIで<br />
Kindle Unlimitedの情報を取得するということです。</p>
<p>ループの頻度ですが、Amazon Product Advertising APIには<br />
頻繁にアクセスするとエラーを返す仕様がある（1秒間に1回以内に抑える）ので<br />
sleepを5秒入れています。</p>
<p>これで実行していたのですが、<br />
「接続済みの呼び出し先が一定の時間を過ぎても正しく応答しなかったため、接続できませんでした。または接続済みのホストが応答しなかったため、確立された接続は失敗しました。」<br />
というエラーが返ってきて中断しましたので、sleep 10秒で再トライしてみます。</p>
<p>英語多読で使えるKindle Unlimitedの本のリストはまとめて公開したいと思います。</p><p>The post <a href="https://ichizo.biz/2016/12/29/kindle-unlimited.html">PythonでAmazon Product Advertising APIを呼び出してKindle Unlimitedの情報を取得する</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://ichizo.biz/2016/12/29/kindle-unlimited.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">100</post-id>	</item>
		<item>
		<title>英語多読用の本をレベル別に取得する（完成版）</title>
		<link>https://ichizo.biz/2016/12/29/python-selenium-3.html</link>
					<comments>https://ichizo.biz/2016/12/29/python-selenium-3.html?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[一蔵]]></dc:creator>
		<pubDate>Thu, 29 Dec 2016 03:52:31 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[英語]]></category>
		<category><![CDATA[Selenium]]></category>
		<guid isPermaLink="false">http://ichizo.biz/?p=94</guid>

					<description><![CDATA[<p>英語多読用の本をレベル別に取得する（完成版） これまでのまと [&#8230;]</p>
<p>The post <a href="https://ichizo.biz/2016/12/29/python-selenium-3.html">英語多読用の本をレベル別に取得する（完成版）</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>英語多読用の本をレベル別に取得する（完成版）</h2>
<h3>これまでのまとめと残りの実装</h3>
<p>検索を行いその結果をリスト化しテキストに保存するという一連の作業を実装します。</p>
<p>検索の実行はPythonでSeleniumを動作させて行います。</p>
<p>英語多読研究会さんのWEBページから、読みやすさレベル別に本のリストを取得するスクリプトの完成版です。</p>
<p>これまで、「<a href="http://ichizo.biz/2016/12/27/python_selenium.html">英語多読用の本のリストをレベル別に取得する</a>」や<br />
「<a href="http://ichizo.biz/2016/12/28/python_selenium-2.html">英語多読用の本をレベル別に取得する（ページャーも対応）</a>」で<br />
実装してきたものの完成版です。</p>
<p>レベル別の英語多読用の本のリストをそれぞれテキストファイルに書き出すという処理です。</p>
<p>読みやすさレベルは、0.0から0.1刻みで10.0まであるので、<br />
それぞれのレベルごとに本のリストを取得して、そのISBNをテキストファイルに書き出します。</p>
<p>今までは書名を取得していたのですが、検索結果の中にISBNが含まれていたことに気が付き、これを取得することにしました。</p>
<h3>プログラムソース</h3>
<p>では、プログラムソースです。</p>
<pre class="lang:python decode:true " title="selenium_english.py" >
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 22 16:32:48 2016

@author: 
"""

from selenium import webdriver

url = 'http://www.seg.co.jp/sss_review/jsp/frm_a_100.jsp'
keyword0 = '100'
level_no = 0
isbn_list = []

def open_window():
    try:
        browser = webdriver.Chrome('./chromedriver')
    finally:
        print('END')
    return browser
        
def search_web(browser, keyword1):
    browser.get(url)
    
    search_input = browser.find_element_by_name('dt_page_in')
    search_input.send_keys(keyword0)

    search_input = browser.find_element_by_name('nm_yle')
    search_input.send_keys(keyword1)

    search_input = browser.find_element_by_name('nm_yls')
    search_input.send_keys(keyword1)
    
    browser.find_element_by_name('Submit3022233').click()
    
    return browser

def go_next_page(browser):
    isFind = True
    page_no = 1
    
    while isFind:
        get_isbns(browser)
    
        page_no += 1
        search_word = '"JavaScript:fncPagnig('+str(page_no)+');"'
        
        if browser.page_source.find(search_word) &gt; 0:
            browser.find_element_by_xpath('//a[@href='+search_word+']').click()
        else:
            isFind = False

def get_isbns(browser):
    subjects = browser.find_elements_by_class_name('subj')
    for subject in subjects:
        if subject.text.find('●ISBN：') &gt; 0:
            isbn = subject.text.split('●ISBN：')
            isbn = isbn[1].split('(')
            isbn_list.append(isbn[0])

def write_file(level_no):
    f = open('list'+str('%1.1f' % level_no)+'.txt', 'w')
    for isbn in isbn_list:
        f.write(isbn)
        f.write('\n')
    f.close()
    

if __name__ == '__main__':
    browser = open_window()
    while level_no &lt; 10:
        browser = search_web(browser, str('%1.1f' % level_no))
        go_next_page(browser)
        write_file(level_no)
        level_no += 0.1
        isbn_list = []
</pre>
<h3>プログラムソースの説明</h3>
<p>ソース下部の</p>
<pre class="lang:python decode:true " >if __name__ == '__main__':</pre>
<p>から各メソッドを実行していますので、ここから説明していきます。</p>
<p>これまではsearch_web()内で</p>
<pre class="lang:python decode:true " >browser = webdriver.Chrome('./chromedriver')</pre>
<p>を行っていたのですが、検索のたびに新しいウィンドウを立ち上げたくなかったので、<br />
別途open_window()メソッドを定義して、1回だけこれを呼び出すことにしました。</p>
<p>読みやすさレベルは、0.0から10.0まで検索を続けるので、<br />
whileループで各レベルごとに検索処理を実行します。</p>
<p>ループ内では、search_web()で検索処理を実行し、<br />
検索結果をgo_next_page()に渡します。</p>
<p>go_next_page()では、検索結果ページごとにget_isbns()を呼び出し、<br />
ページャーのリンクを探します。<br />
ページャーのリンクの数だけ、リンクをクリックし、検索結果をget_isbn()に渡すことを繰り返します。</p>
<p>get_isbns()では、ISBNはclass名が「subj」というtdタグで囲まれているので、<br />
find_elements_by_class_nameで「subj」を指定して中の文字列を取得します。<br />
これで文字列はリストに入るので、この文字列でループし、<br />
「●ISBN」という文字列がある場合だけISBNを取得し、これをリストに追加します。</p>
<p>ISBNをリストに追加し終わったらwrite_file()で<br />
読みやすさレベル別にテキストファイルに保存します。</p>
<p>次にlevel_no（読みやすさレベル）を0.1上げて、<br />
検索結果をセットするリストを初期化しておきます。</p>
<p>以上をlevel_noが10になるまで繰り返します。</p>
<p>注意事項</p>
<p>私は、非常に低スペックのパソコンで実行しているためか、<br />
Seleniumで検索を行ってページ送りしてという動作が非常に緩慢です。<br />
手動で検索を行ってページ送りしてというよりも動作が遅いぐらいです。</p>
<p>ですのでsleepを入れていませんが、<br />
高スペックパソコン等で検索やページ送りの動作が非常に速い場合は<br />
ループの間隔をあけるように適度にsleepを入れましょう。</p><p>The post <a href="https://ichizo.biz/2016/12/29/python-selenium-3.html">英語多読用の本をレベル別に取得する（完成版）</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://ichizo.biz/2016/12/29/python-selenium-3.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">94</post-id>	</item>
		<item>
		<title>英語多読用の本をレベル別に取得する（ページャーも対応）</title>
		<link>https://ichizo.biz/2016/12/28/python_selenium-2.html</link>
					<comments>https://ichizo.biz/2016/12/28/python_selenium-2.html?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[一蔵]]></dc:creator>
		<pubDate>Wed, 28 Dec 2016 08:04:19 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[英語]]></category>
		<category><![CDATA[Selenium]]></category>
		<guid isPermaLink="false">http://ichizo.biz/?p=91</guid>

					<description><![CDATA[<p>英語多読用の本をレベル別に取得する（ページャーに対応する）  [&#8230;]</p>
<p>The post <a href="https://ichizo.biz/2016/12/28/python_selenium-2.html">英語多読用の本をレベル別に取得する（ページャーも対応）</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>英語多読用の本をレベル別に取得する（ページャーに対応する）</h2>
<p>前回の「<a href="http://ichizo.biz/2016/12/27/python_selenium.html">英語多読用の本のリストをレベル別に取得する</a>」に引き続き、<br />
英語多読研究会さんのデータベースから、読みやすさレベル別の書籍リストを取得する実装を行います。</p>
<p>検索結果が多数のページにまたがらないように、結果一覧ページの表示件数を最大の100件にしています。<br />
また読みやすさレベルで細かく分けられるように、検索項目の読みやすさレベルを0.1刻みで上げていく方法を取ります。<br />
他の絞り込み条件を入れると、リストから漏れてしまったりということも考えられなくもないので、<br />
単純に読みやすさレベルを細かく刻むことでその対応とします。</p>
<p>前回の記事で紹介したPythonのソースをさらに書き換えます。</p>
<p>プログラムは以下のようになりました。</p>
<h3>プログラムソース</h3>
<pre class="lang:python decode:true " title="get Book List" >
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 22 16:32:48 2016

@author: 
"""

from selenium import webdriver

url = 'http://www.seg.co.jp/sss_review/jsp/frm_a_100.jsp'
keyword0 = '100'
keyword1 = '0.0'
keyword2 = '0.0'
title_list = []

def search_web():
    try:
        browser = webdriver.Chrome('./chromedriver')
        browser.get(url)
        
        search_input = browser.find_element_by_name('dt_page_in')
        search_input.send_keys(keyword0)

        search_input = browser.find_element_by_name('nm_yle')
        search_input.send_keys(keyword1)

        search_input = browser.find_element_by_name('nm_yls')
        search_input.send_keys(keyword2)
        
        browser.find_element_by_name('Submit3022233').click()
        
        get_titles(browser)

        page_no = 2

        search_word = '"JavaScript:fncPagnig('+str(page_no)+');"'
        page_source = browser.page_source
        while page_source.find(search_word) &gt; 0:
            browser.find_element_by_xpath('//a[@href='+search_word+']').click()
            get_titles(browser)
            page_no += 1
            search_word = '"JavaScript:fncPagnig('+str(page_no)+');"'
            
    finally:
        print('END')

    return title_list

def get_titles(page_text):
    titles = page_text.find_elements_by_xpath('//b')
    isTitle = 0
    for title in titles:
        if isTitle == 0 and title.text == '簡易検索：':
            isTitle = 1
        elif isTitle == 1 and title.text == 'ISBN検索：':
            isTitle = 2
        elif isTitle == 1:
            #print(title.text)
            title_list.append(title.text)

            
if __name__ == '__main__':
    search_web()
    print(title_list)
</pre>
<h3>プログラムソースの内容</h3>
<p>今回は、プログラムの冒頭で、以下のように空のリスト「title_list」を宣言します。</p>
<pre class="lang:python decode:true " >
title_list = []
</pre>
<p>search_web()で英語多読研究会さんのサイトからデータの取得処理を行います。</p>
<pre class="lang:python decode:true " >
browser = webdriver.Chrome('./chromedriver')
</pre>
<p>で、chromedriverを立ち上げて、send_keysで検索項目を指定し、<br />
下記のclick()で検索処理を実行するところまでは前回と同じです。</p>
<pre class="lang:python decode:true " >
browser.find_element_by_name('Submit3022233').click()
</pre>
<p>その後、以下でget_titles()を実行します。</p>
<pre class="lang:python decode:true " >
get_titles(browser)
</pre>
<p>取得した書名リストをtitle_listに追加します。</p>
<pre class="lang:python decode:true " >
title_list.append(title.text)
</pre>
<p>ここまで終わると、再びsearch_web()に戻ります。</p>
<p>ページャーのリンクは、以下のタグです。</p>
<pre class="lang:python decode:true " >
&lt;a href="JavaScript:fncPagnig(2);" style="color=blue;"&gt;2&lt;/a&gt;
</pre>
<p>これをクリックすることで2ページ目に遷移します。</p>
<p>ページャーがあると、&#8221;JavaScript:fncPagnig(2);&#8221; という文字列がページソース内に存在します。<br />
最初に page_no = 2 として、以下のようにsearch_wordという文字列を生成します。</p>
<pre class="lang:python decode:true " >
search_word = '"JavaScript:fncPagnig('+str(page_no)+');"'
</pre>
<p>3ページ以上あることも想定して、page_no をインクリメントし、<br />
その値で生成したsearch_wordで、ページソースを検索します。</p>
<pre class="lang:python decode:true " >
while page_source.find(search_word) &amp;gt; 0:
</pre>
<p>ページソース内にページャーがあった場合はwhileループ内を実行します。</p>
<p>まずは、以下でページャーのリンクをクリックします。</p>
<pre class="lang:python decode:true " >
browser.find_element_by_xpath('//a[@href='+search_word+']').click()
</pre>
<pre class="lang:python decode:true " >
get_titles(browser)
</pre>
<p>で検索結果ページから書名リストを取得します。</p>
<pre class="lang:python decode:true " >
page_no += 1
search_word = '"JavaScript:fncPagnig('+str(page_no)+');"'
</pre>
<p>でpage_noをインクリメントして、その値でリンク先の文字列を生成します。</p>
<p>while文で、この値（次のページのリンク）が存在するかを調べ、<br />
存在する場合は再度ループ内を実行します。</p>
<p>次ページが存在しない場合は、ループを抜けてプログラムを終了します。</p>
<p>次は、書名のリストをテキストファイルに書き出すことと、<br />
これまで固定だった検索項目（読みやすさレベル）を動かして<br />
それぞれの読みやすさレベルごとに書名リストのテキストファイルを<br />
生成することを実装したいと思います。</p><p>The post <a href="https://ichizo.biz/2016/12/28/python_selenium-2.html">英語多読用の本をレベル別に取得する（ページャーも対応）</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://ichizo.biz/2016/12/28/python_selenium-2.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">91</post-id>	</item>
		<item>
		<title>英語多読用の本のリストをレベル別に取得する</title>
		<link>https://ichizo.biz/2016/12/27/python_selenium.html</link>
					<comments>https://ichizo.biz/2016/12/27/python_selenium.html?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[一蔵]]></dc:creator>
		<pubDate>Tue, 27 Dec 2016 07:55:05 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[英語]]></category>
		<category><![CDATA[Selenium]]></category>
		<guid isPermaLink="false">http://ichizo.biz/?p=88</guid>

					<description><![CDATA[<p>英語多読用の本のリストをレベル別に取得したい 英語多読研究会 [&#8230;]</p>
<p>The post <a href="https://ichizo.biz/2016/12/27/python_selenium.html">英語多読用の本のリストをレベル別に取得する</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>英語多読用の本のリストをレベル別に取得したい</h2>
<p>英語多読研究会さんが、<a href="http://www.seg.co.jp/sss_review/jsp/frm_a_100.jsp" target="_blank">英語多読に使える本のデータベース</a>を公開してくれています。<br />
読みやすさレベルを指定して検索することができるので、<br />
自分のレベルに合わせた本を探すのに非常に使い勝手がいいサイトになっています。</p>
<p>このリストから読みたい本を見つけて英語多読に役立てたいところですが、<br />
個別に本を買っていると結構お金がかかってしまいます。</p>
<p>そこで洋書も多いKindle Unlimitedで対象の本があれば<br />
月額980円で読み放題ということで、<br />
より英語多読がやりやすくなります。</p>
<p>ということで、英語多読に役立てたいという目的で、<br />
英語多読研究会さんのデータベースからレベル別に<br />
本のリストを取得することを考えてみます。</p>
<h3>Seleniumを使おう</h3>
<p>レベル別に英語本のリストを取得するには、<br />
検索画面に抽出したいレベルを指定して<br />
検索要求を投げる必要があります。</p>
<p>最初はPythonスクリプトからRequestsを使って<br />
リスト取得することを考えました。</p>
<p>検索項目等の指定をした上で検索要求を投げる訳ですが、<br />
再び検索画面が表示されるだけで、なぜか検索結果画面が表示されません。<br />
（検索画面と検索結果画面のURLが同じで、どうにも受け渡しているパラメーターによって切り替えているっぽいです）</p>
<p>Requestsでヘッダ情報をセットしたり、<br />
検索画面で受け取ったクッキーを検索要求で渡すなどやってみましたが<br />
うまくいかずRequestsでの検索要求はやめることにしました。<br />
（ブラウザから渡しているhidden項目等を渡してみましたがことごとくダメでした）</p>
<p>ということでSeleniumでブラウザを操作して検索結果を取得してみます。</p>
<h3>Seleniumを操作するプログラム</h3>
<p>まずはプログラムソースを。</p>
<p>前回の記事「<a href="http://ichizo.biz/2016/12/22/python-selenium.html">PythonとSeleniumでブラウザの自動操作</a>」で作成したソースを改変します。</p>
<pre class="lang:python decode:true " title="selenium_english.py" >
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 22 16:32:48 2016

@author: 
"""

from selenium import webdriver

url = 'http://www.seg.co.jp/sss_review/jsp/frm_a_100.jsp'
keyword0 = '100'
keyword1 = '0.0'
keyword2 = '0.0'


def search_web():
    try:
        browser = webdriver.Chrome('./chromedriver')
        browser.get(url)
        
        search_input = browser.find_element_by_name('dt_page_in')
        search_input.send_keys(keyword0)

        search_input = browser.find_element_by_name('nm_yle')
        search_input.send_keys(keyword1)

        search_input = browser.find_element_by_name('nm_yls')
        search_input.send_keys(keyword2)
        
        browser.find_element_by_name('Submit3022233').click()
        
        #print(browser.page_source)
        titles = browser.find_elements_by_xpath('//b')
        isTitle = 0
        for title in titles:
            if isTitle == 0 and title.text == '簡易検索：':
                isTitle = 1
            elif isTitle == 1 and title.text == 'ISBN検索：':
                isTitle = 2
            elif isTitle == 1:
                print(title.text)
            #booktext = bookdata.text

        
    finally:
        print('END')


if __name__ == '__main__':
    search_web()
</pre>
<h3>プログラムソースの解説</h3>
<p>keyword0 = &#8216;100&#8217;で、表示件数（100件）、<br />
keyword1 = &#8216;0.0&#8217;とkeyword2 = &#8216;0.0&#8217;で読みやすさレベルを設定しておきます。</p>
<pre class="lang:python decode:true " >
browser = webdriver.Chrome('./chromedriver') 
</pre>
<p>で、Pythonスクリプトと同じディレクトリ内に置いたchrmedriverを読み込みます。<br />
browser.get(url) で指定したURLを開きます。</p>
<pre class="lang:python decode:true " >
search_input = browser.find_element_by_name('dt_page_in')
search_input.send_keys(keyword0)
</pre>
<p>で、dt_page_inにkeyword0（100）をセットします。</p>
<p>同様に「nm_yle」と「nm_yls」に検索項目である読みやすさレベルを指定します。</p>
<pre class="lang:python decode:true " >
browser.find_element_by_name('Submit3022233').click()
</pre>
<p>で検索ボックスをクリックします。</p>
<p>検索結果ページはbrowserに入っていて、<br />
書名は「bタグ」で囲まれているので、書名リストをfind_elements_by_xpathで取得します。</p>
<pre class="lang:python decode:true " >
titles = browser.find_elements_by_xpath('//b')
</pre>
<p>titlesにbタグで囲まれた書名のリストが入っていますが、<br />
それ以外のbタグで囲まれた部分もリストに入っているので、<br />
以下で取り除きます。</p>
<pre class="lang:python decode:true " >
isTitle = 0
for title in titles:
    if isTitle == 0 and title.text == '簡易検索：':
        isTitle = 1
    elif isTitle == 1 and title.text == 'ISBN検索：':
        isTitle = 2
    elif isTitle == 1:
        print(title.text)
</pre>
<p>ここまでで、検索を実行して表示された検索結果ページから<br />
書名のリストを取得する（ただし最初の1ページ目のみ）ということができました。</p>
<p>引き続いて次回は、検索結果が複数ページに渡る場合に<br />
画面を遷移させた上で書名リストを取得し、<br />
これをテキストファイルに出力するということを行います。</p>
<p>Pythonって直観的で使いやすい言語ですね。</p><p>The post <a href="https://ichizo.biz/2016/12/27/python_selenium.html">英語多読用の本のリストをレベル別に取得する</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://ichizo.biz/2016/12/27/python_selenium.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">88</post-id>	</item>
		<item>
		<title>PythonとSeleniumでブラウザの自動操作</title>
		<link>https://ichizo.biz/2016/12/22/python-selenium.html</link>
					<comments>https://ichizo.biz/2016/12/22/python-selenium.html?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[一蔵]]></dc:creator>
		<pubDate>Thu, 22 Dec 2016 07:55:43 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Selenium]]></category>
		<guid isPermaLink="false">http://ichizo.biz/?p=81</guid>

					<description><![CDATA[<p>PythonとSeleniumでブラウザの自動操作 今回は、 [&#8230;]</p>
<p>The post <a href="https://ichizo.biz/2016/12/22/python-selenium.html">PythonとSeleniumでブラウザの自動操作</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>PythonとSeleniumでブラウザの自動操作</h2>
<p>今回は、PythonからSeleniumを動かしてブラウザの自動操作をやってみます。</p>
<p>前回の「<a href="http://ichizo.biz/2016/12/22/python-search.html">PythonのRequestsを使って検索結果を取得する</a>」で、<br />
うまく検索結果を取得できなかったサイトがあったので<br />
今回はSeleniumを使用してみます。</p>
<p>Requestsで取得できなかったのは、見えないところで何らかのパラメーターを渡しているのか、<br />
header情報が必要なのか、画面表示の際にJavaScriptが動いているようなので<br />
これが何かをやっているのか等々なのですが、<br />
ブラウザ操作からは簡単に結果を取得できるので<br />
Requestsは早々に諦めてSeleniumを使ってみることにしました。</p>
<h3>Seleniumとは？</h3>
<p>ブラウザの自動操作ツールです。</p>
<p>Pythonから操作できるということで、Python勉強中の私は<br />
勉強も兼ねてSeleniumを使ってみたいと思います。</p>
<p>まずはSeleniumのインストールです。</p>
<p>これはpipから行えます。</p>
<p>私はWindows環境なので、コマンドプロンプトを管理者権限で立ち上げて<br />
以下のコマンドを実行します。</p>
<pre class="lang:python decode:true " title="install selenium" >
pip install selenium
</pre>
<p>すると以下のようにインストールされます。</p>
<pre class="lang:batch decode:true " title="install selenium" >
Collecting selenium
  Downloading selenium-3.0.2-py2.py3-none-any.whl (915kB)
    100% |################################| 921kB 359kB/s
Installing collected packages: selenium
Successfully installed selenium-3.0.2
</pre>
<p>ブラウザはChromeを使いたいのですが、<br />
ドライバが必要なようです。</p>
<p>ChromeDriverを<a href="https://sites.google.com/a/chromium.org/chromedriver/downloads" target="_blank">ダウンロードサイト</a>からダウンロードします。</p>
<p>「Latest Release:」の後ろの「ChromeDriver 2.26」（2016/12/22現在）の<br />
リンクをクリックするとファイル一覧が表示されます。</p>
<p>「chromedriver_win32.zip」をダウンロードします。</p>
<p>解凍すると「chromedriver.exe」というファイルが現れるので、<br />
これをPythonファイルと同じフォルダ内に移動します。</p>
<h3>Pythonのプログラムを実装</h3>
<pre class="lang:python decode:true " title="searchy.py" >
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 22 16:32:48 2016

@author: 
"""

import time
from selenium import webdriver

url = 'http://search.yahoo.co.jp/search'
keyword = 'python'

def search_web():
    try:
        browser = webdriver.Chrome('./chromedriver')
        browser.get(url)
        time.sleep(1)
        
        search_input = browser.find_element_by_name('p')
        search_input.send_keys(keyword)
        search_input.submit()
        time.sleep(1)
        
        print(browser.page_source)
        
    finally:
        print('END')


if __name__ == '__main__':
    search_web()
</pre>
<p>seleniumのwebdriverを使用するために、「from selenium import webdriver」を宣言します。</p>
<p>対象ページのURLと検索キーワードを設定しておきます。</p>
<p>search_web()内では、「webdriver.Chrome(&#8216;./chromedriver&#8217;)」で<br />
同じディレクトリ内にあるchromedriverを起動します。</p>
<p>「browser.get(url)」でブラウザにURLを渡します。</p>
<p>検索キーワードの入力ボックスのnameが「p」だったので、<br />
「search_input = browser.find_element_by_name(&#8216;p&#8217;)」として指定します。</p>
<p>「search_input.send_keys(keyword)」でキーワードをセットします。</p>
<p>「search_input.submit()」で検索を実行します。</p>
<p>検索結果は「browser.page_source」から取得します。</p>
<p>実際に実行してみると、まずchromedriverが起動し、<br />
次にChromeが立ち上がります。</p>
<p>http://search.yahoo.co.jp/searchに移動し、<br />
検索ボックスに「python」が入力されます。</p>
<p>さらに検索が実行され、検索結果ページが表示されました。</p>
<p>最後にChromeが閉じ、検索結果ページのソースが出力されました。</p>
<p>これだけ簡単な操作だと、実装コードも少なくて簡単ですね。</p>
<p>ちなみに、「検索」ボタンがsubmitではなくて、<br />
onclickでJavasScriptを実行している場合は、<br />
「search_input.submit()」の部分を下記で置き換えます。</p>
<pre class="lang:python decode:true " >
browser.find_element_by_name('Search').click()
</pre><p>The post <a href="https://ichizo.biz/2016/12/22/python-selenium.html">PythonとSeleniumでブラウザの自動操作</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://ichizo.biz/2016/12/22/python-selenium.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">81</post-id>	</item>
		<item>
		<title>PythonのRequestsを使って検索結果を取得する</title>
		<link>https://ichizo.biz/2016/12/22/python-search.html</link>
					<comments>https://ichizo.biz/2016/12/22/python-search.html?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[一蔵]]></dc:creator>
		<pubDate>Thu, 22 Dec 2016 03:31:47 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Requests]]></category>
		<guid isPermaLink="false">http://ichizo.biz/?p=78</guid>

					<description><![CDATA[<p>検索結果一覧を自動取得したい 検索サービスを提供しているWE [&#8230;]</p>
<p>The post <a href="https://ichizo.biz/2016/12/22/python-search.html">PythonのRequestsを使って検索結果を取得する</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>検索結果一覧を自動取得したい</h2>
<p>検索サービスを提供しているWEBページに対して、検索を実行しその結果ページの内容を取得したいということで、<br />
Pythonを使って検索要求を投げ、その結果ページをスクレイピングするプログラムを実装したいと思います。</p>
<p>環境は「<a href="http://ichizo.biz/2016/12/13/anaconda.html">AnacondaでWindows上にPython環境を構築</a>」で構築したWindows上のものを使用します。</p>
<p>PythonのRequestsモジュールを使用します。</p>
<p>RequestsはすでにAnacondaに含まれているようなので、これを使用します。</p>
<p>今回は、Requestsを使って検索リクエストを送信します。</p>
<p>サンプルとして、「python」をYahoo!検索した結果を取得するプログラムを実装してみます。</p>
<pre class="lang:python decode:true " title="searchy.py" >
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 22 11:14:21 2016

@author: arina
"""

import requests

url = 'http://search.yahoo.co.jp/search'
params = {'p':'python',
          'search.x':'1',
          'fr':'top_ga1_sa',
          'tid':'top_ga1_sa',
          'ei':'UTF-8',
          'aq':'',
          'oq':'',
          'afs':'',}

def send_request():
    response = requests.get(url, params)
    print (response.text)


if __name__ == '__main__':
    send_request()
</pre>
<p>これだけでできてしまいました。</p>
<p>URLやパラメーターに使用している値は、Yahoo!のソースを見て取得しました。</p>
<p>検索を行うformタグのURLが「http://search.yahoo.co.jp/search」になっていて、<br />
キーワードを入力するボックスが「p」になっていたので、<br />
paramsに「&#8217;p&#8217;:&#8217;python&#8217;」を指定します。<br />
paramsのほかの値は、form内でhiddenで設定されていたものを入れました。</p>
<p>検索リクエストを送信するのは、「response = requests.get(url, params)」の1行だけです。<br />
Yahoo!ページ内のformタグのmethodが「get」になっていたので、<br />
「requests.get」を使用します。<br />
引数にurlとparamsを指定するだけです。</p>
<p>検索結果はresponse内に入っているので、テキストとして取り出すには<br />
「response.text」とすればOKです。</p>
<p>びっくりするほど簡単でした。</p><p>The post <a href="https://ichizo.biz/2016/12/22/python-search.html">PythonのRequestsを使って検索結果を取得する</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://ichizo.biz/2016/12/22/python-search.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">78</post-id>	</item>
		<item>
		<title>英語多読用リストがKindle Unlimitedに存在するか自動チェックしてみる</title>
		<link>https://ichizo.biz/2016/12/20/english-kindle-unlimited.html</link>
					<comments>https://ichizo.biz/2016/12/20/english-kindle-unlimited.html?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[一蔵]]></dc:creator>
		<pubDate>Tue, 20 Dec 2016 08:50:13 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[英語]]></category>
		<category><![CDATA[Amazon Product Advertising API]]></category>
		<category><![CDATA[bottlenose]]></category>
		<category><![CDATA[Kindle Unlimited]]></category>
		<guid isPermaLink="false">http://ichizo.biz/?p=73</guid>

					<description><![CDATA[<p>PythonでAmazonのKindle Unlimited [&#8230;]</p>
<p>The post <a href="https://ichizo.biz/2016/12/20/english-kindle-unlimited.html">英語多読用リストがKindle Unlimitedに存在するか自動チェックしてみる</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><a href="http://ichizo.biz/2016/12/20/python-kindleunlimited.html">PythonでAmazonのKindle Unlimited情報を取得してみる</a>に続いて、<br />
あらかじめテキストファイルに記載していた書名を取得して<br />
Amazon Product Advertising APIに対して検索を行います。</p>
<h2>Pythonでテキストファイルを開く</h2>
<p>テキストファイルは、以下のようなソースで読み込みます。</p>
<pre class="lang:python decode:true " >
#!/usr/bin/env python

f = open('text.txt', 'r')

for line in f:
    print line
    
f.close()
</pre>
<p>読み込みたいのは以下のようなテキストファイルです。</p>
<pre class="lang:default decode:true " >
Foundations Reading Library
Penguin Readers Easystarts
Oxford Bookworms Starters
Macmillan Readers Starter
Macmillan New Wave Readers Level 1
Oxford Reading Tree
Longman Literacy Land Story Street
Macmillan Springboard
Rookie Readers Fiction
Cambridge Storybooks
Longman Shared Reading
Oxford Start with English Readers
Longman Big and Little Books
CTP Emergent Readers
100 English
Sight Word Readers
Time-to-Discover Readers
Step into Reading Step 1
Step into Reading Step 2
Scholastic Reader Level1
Scholastic Reader Level2
My First I Can Read Books
I Can Read Books Level 1
Penguin Young Readers Level 1
Ready-to-Read Pre-Level 1
Ready-to-Read Level 1
Ready-to-Read Level 2
All Aboard Reading Picture Books
All Aboard Reading Level 1
Puffin Easy-to-Read Level 1
Addison Wesley Big and Little Books
Oxford Classic Tales
Curious George Short Stories
Dorling Kindersley Readers Level 1
Dorling Kindersley Readers Level 2
Oxford Dominoes Stage 0
Penguin Young Readers Level 2
Longman Chatterbox
TL PM Readers
HM Leveled Reading Grade 1
The Very Hungry Caterpillar
Good Night Moon
Brown Bear, Brown Bear, What Do You See?
</pre>
<h3>英語多読用の本のリストが欲しい</h3>
<p>これは何かというと、英語多読用の本のリストです。</p>
<p>SSS英語多読研究会がすすめる「<a href="https://www.seg.co.jp/sss/learning/" target="_blank">非常にやさしい本からはじめ、１００万語単位で読む多読</a>」をやってみたいと思っていたのですが、<br />
多読をするためにはまず教材となる英語の本を用意する必要があります。</p>
<p>SSS英語多読研究会では、<a href="https://www.seg.co.jp/sss/review/osusume.html" target="_blank">レベル別に読むべき本を紹介してくれています</a>。</p>
<p>問題は、多読をするためには大量の本を読まなければいけないのですが、<br />
目安である100万語まで到達するまでにはかなりの本が必要になります。</p>
<p>特にレベルの低いころに読む本は、1冊あたりの字数が少ないために<br />
どうしても本の数が多くなってしまいます。</p>
<p>１冊500円～600円程度で購入できるので、数冊買う分にはいいのですが、<br />
多読となると数十冊単位で読む必要があります。<br />
となると、数万円は軽くかかります。</p>
<p>しかもそのレベルを通り過ぎてしまえば、必要がなくなってしまうという<br />
悲しい運命が待っています。<br />
簡単なものから始めるがゆえに、ほぼ読み捨てしなければならないということです。</p>
<p>そこで目を付けたのが、Kindle Unlimitedです。</p>
<p>読み放題のKindle Unlimitedであれば、お金を気にせず読み進められます。<br />
洋書もかなりの冊数あります（先ほど洋書一覧で見ると137万冊以上あるようです）ので、<br />
きっと多読に使える本もあるはずということです。</p>
<p>ただ、ここで問題になるのは対象になる本を見つける方法です。<br />
リストにあがっている本をいちいち検索するのはメンドくさい、<br />
そもそもKindle Unlimitedにない本もある（ないことが多い）、<br />
効率よく多読するには本を効率よく見つけることも大切だということで<br />
リストからKindle Unlimitedにあるのかを探すプログラムを作ることにしました。</p>
<p>今回検索するリストは、SSS英語多読研究会がレベル0として推薦しているものです。</p>
<h3>書名リストからAmazon Product Advertising APIを呼び出すプログラム</h3>
<p>書名リストのテキストをlevel0.txtとして、Pythonプログラムと同じディレクトリに置きます。</p>
<p>前回の「<a href="http://ichizo.biz/2016/12/20/python-kindleunlimited.html">PythonでAmazonのKindle Unlimited情報を取得してみる</a>」に、ファイルの読み込み処理を組み込みます。</p>
<p>修正したプログラムが以下です。</p>
<pre class="lang:python decode:true " >
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 19 14:49:19 2016

@author: 
"""

from bottlenose import api
from lxml import objectify
import time

AMAZON_ACCESS_KEY_ID = "アクセスキー"
AMAZON_SECRET_KEY = "シークレットキー"
AMAZON_ASSOC_TAG = "アソシエイトタグ"

KINDLE_UMLIMITED_NODE_ID = "4486610051"

amazon = api.Amazon(AMAZON_ACCESS_KEY_ID, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG, Region = "JP")

def file_read (file):
    f = open(file, 'r')
    data = f.read()
    f.close()
    lines = data.split('\n')
    return lines

def item_search (keywords, searchIndex="KindleStore", browseNode=KINDLE_UMLIMITED_NODE_ID):
    response = amazon.ItemSearch(Keywords=keywords, SearchIndex=searchIndex, BrowseNode=browseNode, ResponseGroup="Large")
    root = objectify.fromstring(response)
    return root.Items.Item

if __name__ == '__main__':

    lines = file_read('level0.txt')
    for line in lines:
        for item in item_search(line):
            title = item.ItemAttributes.Title
            author = item.ItemAttributes.Author
            url = item.DetailPageURL
            print ("%s\n%s\n%s\n%s\n\n" % (line, title, author, url))
        time.sleep(5)   # Amazon API呼び出しは1秒に1回以内に収めるためsleep
</pre>
<p>file_readというメソッドを作って、ここでテキストファイルを読み込み<br />
１行ずつを配列の各要素に入れて返します。</p>
<p>file_readの呼び出し元では、返り値でループさせます。<br />
その際に、sleep(5)を入れています。</p>
<p>これで実行してみると、<br />
「AttributeError: no such child: {http://webservices.amazon.com/AWSECommerceService/2013-08-01}Item」<br />
というエラーで終了します。</p>
<p>APIの結果がない場合にエラーで落ちてしまっています。<br />
今度はこれの対策を考えます。</p>
<p>以下のように書き換えてみました。</p>
<pre class="lang:python decode:true " >
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 19 14:49:19 2016

@author: 
"""

from bottlenose import api
from lxml import objectify
import time

AMAZON_ACCESS_KEY_ID = "アクセスキー"
AMAZON_SECRET_KEY = "シークレットキー"
AMAZON_ASSOC_TAG = "アソシエイトタグ"

KINDLE_UMLIMITED_NODE_ID = "4486610051"

amazon = api.Amazon(AMAZON_ACCESS_KEY_ID, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG, Region = "JP")

def file_read (file):
    f = open(file, 'r')
    data = f.read()
    f.close()
    lines = data.split('\n')
    return lines

def item_search (keywords, searchIndex="KindleStore", browseNode=KINDLE_UMLIMITED_NODE_ID):
    response = amazon.ItemSearch(Keywords=keywords, SearchIndex=searchIndex, BrowseNode=browseNode, ResponseGroup="Large")
    root = objectify.fromstring(response)
    return root.Items

if __name__ == '__main__':

    lines = file_read('level0.txt')
    for line in lines:
        items = item_search(line)
        item_find = items.find('Item')
        if (item_find is not None):
            for item in item_find:
                if (item is not None):
                    title = item.ItemAttributes.Title
                    author = item.ItemAttributes.Author
                    url = item.DetailPageURL
                    print ("%s\n%s\n%s\n%s\n\n" % (line, title, author, url))
                else:
                    print ("%s : Book is None" % (line))
        print ("END %s" % (line))
        time.sleep(5)   # Amazon API呼び出しは1秒に1回以内に収めるためsleep
</pre>
<p>調べてみると、「root.Items.find(&#8216;Item&#8217;)」は、<br />
Itemが空の時Noneを返すということなので、<br />
「items.find(&#8216;Item&#8217;)」をitem_findに放り込んで<br />
これがNoneの場合は処理しないようにしました。</p>
<p>結果はというと、以下のようになりました。</p>
<pre class="lang:default decode:true " >
END Foundations Reading Library
END Penguin Readers Easystarts
END Oxford Bookworms Starters
END Macmillan Readers Starter
END Macmillan New Wave Readers Level 1
END Oxford Reading Tree
END Longman Literacy Land Story Street
END Macmillan Springboard
END Rookie Readers Fiction
END Cambridge Storybooks
END Longman Shared Reading
END Oxford Start with English Readers
END Longman Big and Little Books
END CTP Emergent Readers
END 100 English
END Sight Word Readers
END Time-to-Discover Readers
END Step into Reading Step 1
END Step into Reading Step 2
END Scholastic Reader Level1
END Scholastic Reader Level2
END My First I Can Read Books
END I Can Read Books Level 1
END Penguin Young Readers Level 1
END Ready-to-Read Pre-Level 1
END Ready-to-Read Level 1
END Ready-to-Read Level 2
END All Aboard Reading Picture Books
END All Aboard Reading Level 1
END Puffin Easy-to-Read Level 1
END Addison Wesley Big and Little Books
END Oxford Classic Tales
END Curious George Short Stories
END Dorling Kindersley Readers Level 1
END Dorling Kindersley Readers Level 2
END Oxford Dominoes Stage 0
END Penguin Young Readers Level 2
END Longman Chatterbox
END TL PM Readers
END HM Leveled Reading Grade 1
END The Very Hungry Caterpillar
END Good Night Moon
END Brown Bear, Brown Bear, What Do You See?
END 
</pre>
<p>結果は全滅・・・。<br />
一つもKindle Unlimitedにはないという結果に。</p>
<p>そしてなぜか「if (item is not None):」のelse部分を通ってくれなかったという謎も。</p>
<p>リストを広げて再取得してみることにします。</p><p>The post <a href="https://ichizo.biz/2016/12/20/english-kindle-unlimited.html">英語多読用リストがKindle Unlimitedに存在するか自動チェックしてみる</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://ichizo.biz/2016/12/20/english-kindle-unlimited.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">73</post-id>	</item>
		<item>
		<title>PythonでAmazonのKindle Unlimited情報を取得してみる</title>
		<link>https://ichizo.biz/2016/12/20/python-kindleunlimited.html</link>
					<comments>https://ichizo.biz/2016/12/20/python-kindleunlimited.html?noamp=mobile#respond</comments>
		
		<dc:creator><![CDATA[一蔵]]></dc:creator>
		<pubDate>Tue, 20 Dec 2016 03:10:39 +0000</pubDate>
				<category><![CDATA[Python]]></category>
		<category><![CDATA[Amazon Product Advertising API]]></category>
		<category><![CDATA[bottlenose]]></category>
		<category><![CDATA[Kindle Unlimited]]></category>
		<guid isPermaLink="false">http://ichizo.biz/?p=53</guid>

					<description><![CDATA[<p>Kindle Unlimitedって検索しずらい Kindl [&#8230;]</p>
<p>The post <a href="https://ichizo.biz/2016/12/20/python-kindleunlimited.html">PythonでAmazonのKindle Unlimited情報を取得してみる</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></description>
										<content:encoded><![CDATA[<h2>Kindle Unlimitedって検索しずらい</h2>
<p>Kindle Unlimitedを利用しているのですが、いまいち検索しずらいので<br />
該当の本がKindle Unlimitedで読めるのかを取得するプログラムを作ってみます。</p>
<p>PythonからAmazon Product Advertising APIを呼び出すプログラムを実装してみます。</p>
<p>環境は、「<a href="http://ichizo.biz/2016/12/13/anaconda.html">AnacondaでWindows上にPython環境を構築</a>」で構築したものを使用します。</p>
<p>Windows上でインストールしたAnacondaで一緒に入っているSyderを使用します。</p>
<p>Syderを立ち上げて、まずはプロジェクトを作成します。</p>
<p>メニューのProjectsから「New Project&#8230;」をクリックします。</p>
<p>プロジェクト名とプロジェクトで使用するフォルダを指定します。</p>
<h2>作成したいPythonプログラム</h2>
<p>作成したいプログラムは、書名で検索してその本がKindle Unlimitedに<br />
登録されているかを返すというものです。</p>
<p>現在、Kindle Unlimitedを利用中なのですが、<br />
Kindle Unlimitedだけを対象とした検索って<br />
いまいちやりずらいんです。</p>
<p>そこで、書名から検索してそれがKindle Unlimitedの対象になっているかを<br />
調べるプログラムを作ろうと思った次第です。</p>
<p>書名は1冊ではなく複数調べたいので、<br />
入力はテキストファイルにリストで書いておいて<br />
それを読み込むようにしたいと思います。</p>
<p>出力は、書名とそれがKindle Unlimitedに存在するかの真偽値を<br />
記載するようにすればよいでしょう。</p>
<h3>Amazon Product Advertising API用のライブラリを利用する</h3>
<p>Pythonには、Amazon Product Advertising API用のライブラリがあるようなので、それを利用させてもらいます。</p>
<p>まずはbottlenoseというライブラリをインストールします。</p>
<p>コマンドプロンプトを立ち上げる際に右クリックして、<br />
「その他」から「管理者として実行」をクリックします。</p>
<p>以下のコマンドを実行します。</p>
<pre class="lang:python decode:true " >pip install bottlenose</pre>
<p>これでインストールできました。</p>
<p>pipのバージョンが古いというメッセージが出ましたので、<br />
ついでにpipのバージョンも上げておきます。</p>
<pre class="lang:python decode:true " >python -m pip install --upgrade pip</pre>
<h3>Pythonプログラムのコーディング</h3>
<p>準備ができたので、さっそくPythonプログラムを実装します。<br />
今度はSpyderのエディタでコーディングを行います。</p>
<p>まずは簡単に、キーワードを指定して該当する書籍の 書名、著者名、URLを返すプログラムを書きます。</p>
<pre class="lang:python decode:true " >
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 19 14:49:19 2016

@author:
"""

from bottlenose import api
from lxml import objectify

AMAZON_ACCESS_KEY_ID = "アクセスキー"
AMAZON_SECRET_KEY = "シークレットキー"
AMAZON_ASSOC_TAG = "アソシエイトタグ"

amazon = api.Amazon(AMAZON_ACCESS_KEY_ID, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG, Region = "JP")

def item_search (keywords, searchIndex="Books"):
    response = amazon.ItemSearch(Keywords=keywords, SearchIndex=searchIndex, ResponseGroup="Large")
    root = objectify.fromstring(response)
    return root.Items.Item

if __name__ == '__main__':

    for item in item_search('python'):
        title = item.ItemAttributes.Title
        author = item.ItemAttributes.Author
        url = item.DetailPageURL
        print ("%s\n%s\n%s\n\n" % (title, author, url))
</pre>
<p>lxmlはAnacondaに含まれていましたので、インストールする必要はありませんでした。</p>
<p>これで、「python」というキーワードに該当する本の<br />
タイトル、著者名、URLを取得することができました。</p>
<h3>Kindle Unlimitedを対象に検索する</h3>
<p>上記では、「searchIndex=&#8221;Books&#8221;」として、本のカテゴリから検索しましたが、<br />
次はKindle Unlimitedカテゴリ内を検索するようにします。</p>
<p>すでに実装されている方がいらっしゃったので、参考にさせていただきます。</p>
<p><a href="http://stonebeach-dakar.hatenablog.com/entry/Ruby%E3%81%A7Amazon%E3%81%AEAPI%E3%82%92%E4%BD%BF%E3%81%A3%E3%81%A6Kindle_Unlimited%E6%9C%AC%E3%81%AE%E4%B8%80%E8%A6%A7%E3%82%92%E5%8F%96%E5%BE%97%E3%81%99%E3%82%8B%E3%80%82" target="_blank">RubyでAmazonのAPIを使ってKindle Unlimited本の一覧を取得する。</a></p>
<p>こちらの方の記事によると、searchIndexを「KindleStore」にして<br />
browseNodeを追加してKindle UnlimitedのノードID「4486610051」を指定してやればよいようです。</p>
<p>で、実装してみました。</p>
<pre class="lang:default decode:true " >
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 19 14:49:19 2016

@author:
"""

from bottlenose import api
from lxml import objectify

AMAZON_ACCESS_KEY_ID = "アクセスキー"
AMAZON_SECRET_KEY = "シークレットキー"
AMAZON_ASSOC_TAG = "アソシエイトタグ"

KINDLE_UMLIMITED_NODE_ID = "4486610051"

amazon = api.Amazon(AMAZON_ACCESS_KEY_ID, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG, Region = "JP")

def item_search (keywords, searchIndex="KindleStore", browseNode=KINDLE_UMLIMITED_NODE_ID):
    response = amazon.ItemSearch(Keywords=keywords, SearchIndex=searchIndex, BrowseNode=browseNode, ResponseGroup="Large")
    root = objectify.fromstring(response)
    return root.Items.Item

if __name__ == '__main__':

    for item in item_search('python'):
        title = item.ItemAttributes.Title
        author = item.ItemAttributes.Author
        url = item.DetailPageURL
        print ("%s\n%s\n%s\n\n" % (title, author, url))
</pre>
<p>変更した個所は、item_searchでsearchIndexを「KindleStore」に変更して<br />
browseNodeを追加しただけです。</p>
<p>これを実行してみたところ、きちんとKindle Unlimited対象商品がリストに上がってきます。</p>
<p>これで、Amazon Product Advertising APIからKindle Unlimitedの電子書籍を取得することができました。</p>
<p>次回からは、いよいよ書名のリストからそれがKindle Unlimitedにあるかを取得するプログラムに進みます。</p><p>The post <a href="https://ichizo.biz/2016/12/20/python-kindleunlimited.html">PythonでAmazonのKindle Unlimited情報を取得してみる</a> first appeared on <a href="https://ichizo.biz">イチゾーのブログ</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://ichizo.biz/2016/12/20/python-kindleunlimited.html/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">53</post-id>	</item>
	</channel>
</rss>
