What's Happening with Your Microsoft Advertising's Search Campaigns? - Sophie...
Automate your SEO checks with Python 2017
1. Anita Valentinova
Senior Marketing Specialist - SEO @Vistaprint
Power of simple Python scripts to automate
SEO checks
@alfina87
https://alfianita.me
April 7th, 2017
2. Experienced search professional, passionate about digital
marketing and technology
Like finding issues, but more excited about getting them fixed!
Get in touch:
Alfianita.me
@alfina87
Power of simple Python scripts to automate
SEO checks
#brightonSEO @alfina87
3. Vistaprint - leader in providing a vast array of high quality,
custom-printed marketing materials for small business
owners
21 Vistaprint locales around the globe
Big websites (40 000 + pages)
Power of simple Python scripts to automate
SEO checks
#brightonSEO @alfina87
4. Power of simple Python scripts to automate
SEO checks
Contents
#brightonSEO @alfina87
Website health check
Automated SEO QA
Python – what and why
Use cases
Simple script to check meta data – use case, code, how to run
Script results
5. Power of simple Python scripts to automate
SEO checks
SEO for large websites
Different „animal” (no Pandas & Penguins
hungry sharks can eat traffic overnight)
SEO for small to mid-sized websites
No issues? Think twice!
You know, nobody wants to mess up canonicals & meta robots
noindex #brightonSEO @alfina87
6. Has your website ever had problems with one of the following:
Power of simple Python scripts to automate
SEO checks
Indexation
Canonicalization
Website migrations
Broken links
#brightonSEO @alfina87
7. Power of simple Python scripts to automate
SEO checks
Test Automation
Using software, scripts to control
the execution of tests
Comparison of actual outcomes with
predicted outcomes
Automation of repetitive but necessary tasks
#brightonSEO @alfina87
8. Power of simple Python scripts to automate
SEO checks
Releases
Content changes
Deployment issues
Meta robots noindex
Redirect mapping
Automated SEO QA Checks
- QA or SEO
#brightonSEO @alfina87
9. Power of simple Python scripts to automate
SEO checks
Why do you need automated SEO checks?
Too busy putting out fires to
get anything important done?
#brightonSEO @alfina87
How to change from being reactive to proactive?
10. Power of simple Python scripts to automate
SEO checks
Disclaimer
Trust me…But
I am not a Computer Science engineer or a Python expert :)
(you don’t have to be either)
#brightonSEO @alfina87
11. Power of simple Python scripts to automate
SEO checks
What I know: how do I hack the way I work?
Focus on thinking & designing solutions
Do you need to use code on a daily basis? --> No! Don’t be
intimidated by code
Learn Python foundations to read code, create scenarios
#brightonSEO @alfina87
12. Power of simple Python scripts to automate
SEO checks
What is Python?
Favourite programming language to
many
Reference to British Comedy Group
Monty Python
Solid programs, simple to complex
automations and effective scripts
#brightonSEO @alfina87
13. Power of simple Python scripts to automate
SEO checks
Write and run Python code (.py files) with a simple text editor,
supporting syntax highlighting:
Python’s IDLE
Notepad ++
PyCharm
Sublime text
Get comfortable with the Command Line
#brightonSEO @alfina87
14. Power of simple Python scripts to automate
SEO checks
Python for You – Use Cases
Thousands of issues
Countless manual checks?
Optimized meta data disappeared?
Scraping competitors’ pages
Checking headings
Scraping competitors’ prices
Structured data wiped out
Fancy wasting
precious time?
No way!
#brightonSEO @alfina87
15. Power of simple Python scripts to automate
SEO checks
Simple script - learn by example
Problem: Multiple content editors change meta data for key product
pages. SEO doesn’t receive any notifications
Result: SEO team is aware of any changes.
#brightonSEO @alfina87
16. Power of simple Python scripts to automate
SEO checks
Solution: Python Script which parses the HTML, compares current
vs. expected values, sends an email alert with any discrepancies
No manual checks
Timely notifications
Spend time on finding the solution (get in touch with
stakeholders, change meta data, improve communication etc.)
#brightonSEO @alfina87
17. Power of simple Python scripts to automate
SEO checks
Simple script - Preparation
All script files should be in the Python folder:
Script
Script Configuration file
Chromedriver
#brightonSEO @alfina87
18. Power of simple Python scripts to automate
SEO checks
How to run the script
All files in 1 place
Run the main script file, located in the folder
Use CM to run the script
#brightonSEO @alfina87
19. Power of simple Python scripts to automate
SEO checks
This is what you should expect once you open the code:
#brightonSEO @alfina87
20. Power of simple Python scripts to automate
SEO checks
#brightonSEO @alfina87
Defining
functions
21. Power of simple Python scripts to automate
SEO checks
Script in action
Chromedriver opens the pages from the Excel file
#brightonSEO @alfina87
22. Power of simple Python scripts to automate
SEO checks
Script – Reading and Writing to Excel
Script parses HTML from the current pages
Records values in a new tab with the date
Before – input After – output
#brightonSEO @alfina87
23. Power of simple Python scripts to automate
SEO checks
Email alert
#brightonSEO @alfina87
24. Power of simple Python scripts to automate
SEO checks
Behind the scenes
Messages during the execution of the
script
#brightonSEO @alfina87
25. Power of simple Python scripts to automate
SEO checks
Your turn – action items
Think about use cases, write scenario
Sending automated SEO reports to your boss every
week?
Validate your idea. Is it worth it? Automation is not a silver
bullet
#brightonSEO @alfina87
26. Power of simple Python scripts to automate
SEO checks
SEO is a race
Try, fail, keep trying, succeed, measure and
optimize your productivity
#brightonSEO @alfina87
27. #brightonSEO @alfina87
Power of simple Python scripts to automate
SEO checks
Resources:
Try it, download the script files here
You can do it! Article with more info –
https://www.alfianita.me/python-for-seo-checks-meta-
data/
28. Power of simple Python scripts to automate
SEO checks
#brightonSEO @alfina87
Key takeaway
Want to be on top of your SEO 24/7 in 2017?
Don’t forget the basics! Try some automated
Python scripts or simply ask your developer
create them for you!
29. #brightonSEO @alfina87
Power of simple Python scripts to automate
SEO checks
Thank you!
Questions? Drop me a line and share your questions or
experience with Python!
Happy Optimizing & Think(Script)ing!