Sunday, September 27, 2015

Your own Broken Link Checker

Python Script : Crawl a website ,take screenshots and save it in word doc.

Steps to execute this script
  1. Create a folder 'link Checker' and place this script in it.
  2. Create a folder 'shots' and place it inside  'link Checker' folder.
  3. Change below variables 
    • url ="website url"
    • SaveDirectory=r ''screenshot directory"
  4. Execute the program.

 import requests  
 from BeautifulSoup import BeautifulSoup  
 import webbrowser  
 import os  
 import sys  
 import time  
 import Image  
 import ImageGrab  
 import win32com.client as win32  
 import os  
 import time  
 import glob  
 url = "http://www.dhatricworkspace.com"  
 response = requests.get(url)  
 # parse html  
 page = str(BeautifulSoup(response.content))  
 alllist = [];  
 httplist = [];  
 otherlist = [];  
 SaveDirectory=r'C:\Users\Giridhar\Desktop\link Checker\shots'  
 ImageEditorPath=r'C:\WINDOWS\system32\mspaint.exe'  
 def getURL(page):  
   """  
   :param page: html of web page (here: Python home page)   
   :return: urls in that page   
   """  
   start_link = page.find("a href")  
   if start_link == -1:  
     return None, 0  
   start_quote = page.find('"', start_link)  
   end_quote = page.find('"', start_quote + 1)  
   url = page[start_quote + 1: end_quote]  
   return url, end_quote  
 while True:  
   url, n = getURL(page)  
   page = page[n:]  
   if url:  
     #print url  
     alllist.append(url)  
   else:  
     break  
 #print alllist  
 for httpurl in alllist:    
   if httpurl.find("http")!=-1:  
     httplist.append(httpurl)  
   else:  
     if httpurl.endswith("/",0,1):  
       otherlist.append(httpurl)  
 #print httplist  
 #print otherlist  
 new = 0  
 i=1  
 for browsing in httplist:  
   webbrowser.get('windows-default').open(browsing,new=new)  
   time.sleep(10)  
   img=ImageGrab.grab()  
   print browsing  
   saveas=os.path.join(SaveDirectory,'ScreenShot_'+str(i)+'.jpg')  
   img.save(saveas)  
   i += 1  
   if i == 10:  
     break;  
 #---------------------------------code to move images to word-------  
 allpics = []  
 allpics=glob.glob(os.path.join(os.path.abspath("."),'shots/*.JPG'))  
 wordApp = win32.gencache.EnsureDispatch('Word.Application') #create a word application object  
 wordApp.Visible = False # hide the word application  
 doc = wordApp.Documents.Add() # create a new application  
 for pic in allpics:  
   current_pic = doc.InlineShapes.AddPicture(pic)  
   current_pic.Height= 400  
   current_pic.Width= 400  
 doc.SaveAs(os.getcwd()+'\\dhatricworkspace.docx')  
 wordApp.Application.Quit(-1)  


After execution of script ,it will automatically open the default browser and crawl all the pages it in and takes screenshot of all pages.

Once done with the screenshots it will create a doc file with all screenshots in it.



48 comments:

Green Grace said...

Your blog is really very interesting information regarding real estate.
Green Grace
Vertex Panache
Assetz 63 Degree East

Pranavi said...

Nice Blog... Thank you for sharing this information..

Provident Kenworth
Vaswani Menlo Park
Marina Skies

Unknown said...

It's really a great and helpful piece of line.I am glad that you shared this helpful info with us.Please keep us informed like this.
Thanks for sharing.

Lanco Hills Hyderabad
sai keerthi prime Hyderabad
Ramky One Kosmos
Bella Vista Villas

Pranavi said...

Nice Blog... Thank you for sharing this information..

Provident Kenworth
Vaswani Menlo Park
Marina Skies
Prestige Jindal

Gayathri said...

Nice Blog... Thank you for sharing this information

Mahindra Lifespaces Ashvita
Incor One City
Kalpataru Residency
The Botanika
Lodha Bellezza

Unknown said...

The pressure of academic assignment can be quite a painful thing. So, if you are feeling wondering, “Who can help me in writing my papers?” then you can simply take the paper help from us at MyAssignmenthelp.com.
We boast of a 5000+ strong team of paper writers who are highly qualified and have been providing paper writing help for the past ten years. They can help you submit well-written papers and score better grades. From elementary to high school, from college to university - we provide research paper writing service for all kind of papers.

etharparker said...

Allessaywriter.com is the home of the best essay writing service in the world Is “I need help writing my essays,” the first thought on your mind? Does it cause you stress even when you’re trying to relax? Are you thinking about employing essay help? Then do we have news for you! Allessaywriter.com is here to make you an offer you cannot refuse!
For the cheapest rates, we offer you our time-tested service, which includes but is not limited to:
Guaranteed 100% plagiarism-free content
Delivery straight to your mailbox on time, every time
24/7 live online help service to clear all doubts and questions
We bring our 1500+ team of PhD holding experts to bear on every assignment. Our dedication to quality is what makes us the best essay writing service in the market.

Max Willor said...

A special thanks to My Assignment Help for providing a well-written assignment. You guys were a savior to me. Will contact you soon for my upcoming assignments. You can email us at cs@Myassignmenthelpau.Com or Phone Number: +61-2-8005-8227

Joy Brick said...

Are you worried about on-time assignment submission? Talk to our expert and complete your homework using remarkable Project Management Assignment Help
Project Management Homework Help

Alpha Assignment Help said...


The good thing about this blog is that I can relate to it myself. It is surely going to help me in my future endeavors. Keep up the good work.
Report Writing Services

john amber said...

Thank you for this wonderful information looking forward for more. We are Providing the best quality assignment help. You will find out online My Assignment Help service on firstassignmenthelp. And these services are very reliable, and they can provide information about any topic related to the academics. If you need any college level Assignment Help at reliable quality with better work. Kindly visit our website firstassignmenthelp.

Expo 2020 said...

I enjoy kinds very own post. It will be respectable to get a single narrative inside and outside of the core of this distinctive core specialized niche will likely be commonly knowledgeable.
expo 2020

printersupportnumber said...

Nice Post...
From last two or three weeks, my HP printer is not printing any document. I am facing this technical error from a long time, so I want to take effective resolutions for it. I try to know actual reasons for it, but I am unable to recognize them. I am looking for technical support services from a reliable support provider just like www.support.hp.com. I want to take an expert’s help from reliable support provider for resolving HP Printer Not Printing issue. So please suggest me the name of a reliable technical support provider.

Caleb said...

Thank you for bringing to a halt my long search topic. I really benefited from your content. If you are experiencing trouble striking a balance between your busy academic life and handling your online classes, you can get help from a professional who will take online classes on your behalf. It doesn’t matter the kind of help you need, whether it is passing your exam, finishing your assignments or even the entire classwork, you can get help here at Online Class Help .

James Ian said...

Thank you for sharing such an informative article. Most people buy coffee already roasted, but if you want the freshest, most flavorful beans, you may want to roast your own. Before roasting, coffee beans are green and grassy. The high temperatures used to roast the beans cause chemical changes to bring out the aroma and flavor that you love. Visit Best Home Coffee Roasters for more.

abcassignmenthelp said...

ABC Assignment Help is an incomparable online assignment help company delivering excellent academic assignments, essays, coursework and reports. Through a team of over 3000 subject experts we ensure individual attention to every student making the assignment help experience completely personalized in nature. With our round the clock services, you can be assured of high grades every time.

HP Printer Setup said...

By playing pogo games, you get rewarded for winning or playing. So, if you wish to know which pogo games reward you with the moat tokens are High Stakes Poker, Dragon Age: Inquisition, Dragon Age 2 and Dragon Age: Origins. Other than this, Trivial Pursuit is another good option for earning tokens. For further information, you may dial the pogo tech support phone number.

Jenifer said...

If anyone looking for expert’s assistance for their assignments, then he/she can opt our best college assignment help service for their any subject. We have experts for every subject, who have done their Ph.D.’s in same field from top universities in Australia. So, you don’t need take tension, just hire us and sit relax!

Silvia said...

Hello there, great stuff you’ve shared here I will be checking regularly for more articles. But wait! When it becomes hard to manage your online assignment, availing Online Assignment Help is the best choice. Many students often fail to submit their assignment before deadlines and end up scoring low grades because they didn’t have enough time to write the assignment given on time and satisfactorily. Visit Assignment Help . for assistance.

My Assignment Help Online said...

Myassignmenthelp is an incomparable online assignment writing service delivering excellent Science assignment help service. Through a team of over 3000 subject experts we offer individual attention to every student making the assignment help experience completely unique and stress-free for students aiming to score high in every assignment. We even offer you free samples on our website that can be used as a quality reference to write a fresh piece of work and improve your grades.

Assignment Help Australia said...

Assignment Help services make a strong connection with professional writers and subject matter experts in Australia. Access the services of professional academic writers in just a few steps from the education platform of online assignment writing services even in Australia.
My Assignment Help
Assignment Help Online
Online Assignment Help
Assignment Help Australia

James Wick said...

Students must avail of online assignment help service if they want to hire someone to do my assignment. Grab academic writing services to boost your knowledge as well as marks efficiently. Well if you get time you must read more
do my assignment for me
pay someone to do assignment

James Martin said...

Take the option of assignment help online services in Ireland and finish your work before the due dates. While studying in Ireland Universities, you have to deal with plenty of academic work that can be solved easily with Assignment Help services.

James Ian said...

This is the greatest articles I have come across on internet. Most nurses work and study at the same time which makes them lack time to work on their nursing papers. Nursing also covers a wide range of topics that need thorough research especially when students have nursing papers to work not. Do not fret when Write My nursing Paper for me . is here. Our team of writers is skilled and knowledgeable in all nursing areas.

James Ian said...

Your article is fascinating and tell you what? I have bookmarked your site and even shared to my friends. There are several key things that you must aim at accomplishing when writing a BSN capstone. First of all, you must demonstrate that you can satisfactorily design and conduct a study that aims at improving the roles that the field of nursing plays in ensuring that people have access to quality healthcare. Moreover, you must proof that you are capable of improving the quality of life of a given target population by designing and implementing a program or intervention model that is based on verifiable and credible evidence. Learn more from BSN Capstone Writing Help .

Ryansnow said...

Is MyAssignmentHelp Fraud? |A super honest myassignmenthelp review. This review includes an indepth analysis of company’s stature, assessment of their services along with how student’s view the company.

Nick Hebrew said...

Such a wonderful information blog post on this topic Allassignmentservices.com provides assignment service at affordable cost in a wide range of subject areas for all grade levels, we are already trusted by thousands of students who struggle to write their academic papers and also by those students who simply want ERP Assignment writing sevices to save their time and make life easy.

James Ian said...

Hi, this is a wonderful piece of writing. I want to say that a nursing professional portfolio is a must-have document for every nurse. It contains everything a nurse needs in their career. The idea is to collect everything and have it in one place to easily trace them whenever you need them. There are nursing students who finding compiling the documents and putting them in one place difficult and opt to look for help in a platform like Nursing Professional Portfolio . Luckily, we are always here to help.

justin hammer said...

Tired of getting poor grades in your microeconomics assignment? I am an economics graduate from the London School of Economics. I have been offering economics assignment help for the last 7 years. Over this period, I have worked with thousands of students ensuring that they get high-quality assignment solutions. I also handle final year economics projects. If you want to reduce that college pressure, contact me for quality economics homework help. I am available at https://www.economicshomeworkhelper.com/

justin hammer said...

Day made. My homework was completed earlier than expected. With my final year project now complete I will be taking programming assignment help from you for my remaining assignments. In the next two days, I need a C assignment help expert to work on my assignment. I think I might go with Hayez again because he was amazing in this previous paper.


justin hammer said...

Working online for any job as an online tutor or like you who helps students with statistics assignment has its risks. Risks are inevitable, as one person once said. Are you open to sharing? I know there is that weird experience you have ever had with a student who contacts you to do their statistics assignment. Would you like to share? It can help us learn. I am an Econometrics assignment help expert and therefore I want to help students too. I am also open to partnering with you on statistics homework help .

justin hammer said...

So I am here to talk about something that happened to me last week when I logged into the site to get Matlab assignment help. I always love the fact that the Matlab homework help experts here work round the clock but on this particular day, I placed an order for a signal processing task but no one responded to my request until three hours. This was worrying because I needed the assignment done quickly as it was due the following day. Even though you did meet my deadline, please improve on your communication.

justin hammer said...

Tired of getting poor grades in your microeconomics assignment? I am an economics graduate from the London School of Economics. I have been offering economics assignment help for the last 7 years. Over this period, I have worked with thousands of students ensuring that they get high-quality assignment solutions. I also handle final year economics projects. If you want to reduce that college pressure, contact me for quality economics homework help. I am available at https://www.economicshomeworkhelper.com/

Ian said...

Kudos. I appreciate the effort you make to give out article like this. Winning the BSG is not that easy. You need to be aware of some of the effective business strategy game simulation tips through which you can stay ahead of the competition. Here, business is not only about selling, but there’s also much more you need to be aware of. Go ahead and reach out to us for Bsg Game Help

PPT said...

I couldn’t ignore the art of writing you have to ensure you deliver the best. If you are a student working on a paper that requires data analysis such as a statistical research project or a dissertation on the location of features and boundaries around the earth, the major challenge you are likely to face is getting a better understanding of the data and materials that you’ve gathered. Go ahead and reach out to us for Data Analysis Help

Anna Jones said...
This comment has been removed by the author.
Anna Jones said...

Nice Post, I love this post. Keep sharing
I am anna, a professional engineering teacher, Being a professional engineering teacher, online study is the best solution for the new generation, if you are looking for online study materials. i am here helps you out by providing different subjects textbook solutions manuals"

Chrisrogers62060 said...

I am utterly pleased with the services that they offered me on my SAS assignment. The Statistics assignment help expert I worked with did everything to perfection. They are very professional in what they do. I do not have enough words to praise their services. Once they were done with my assignment, I offered them a new task. Contact them if you are looking for an statistics homework help expert to do your statistics homework at an affordable price.

Chrisrogers62060 said...

I have not been able to find an Economics Assignment Help expert with the ability to offer quality and timeliness. If you can offer the two, I wouldn’t have a problem keeping you as my full-time Economics homework help expert. I am still in my second year and therefore I am looking for one reliable expert who we can work together until I finish school.

Chrisrogers62060 said...

Hi. I have just come across your Programming homework help portal. I have a Java assignment which is required in 48 hours. I am therefore looking for an effective and timely person to provide Java homework help for me. If you are in a position to complete the task in 48 hours please reply to my email. I have indicated all the instructions in the email I have sent. And as you reply to the email please send a sample done by you. Thank you. I will requireC++ homework help, Python Homework Help and C homework help experts shortly. It will be great if I can find anyone who provides complete Programming Coursework Help.

Chrisrogers62060 said...

I was referred to MatlabAssignmentExperts by a friend because I needed help completing my communication systems assignment. When I submitted my requirements, I thought maybe the Matlab homework helptutor handling the paper would like to discuss the task a little bit more with me before they started working on it but that was not the case. There was no communication until when they were delivering the work. I am glad they sent me a quality solution but I still feel constant communication would go a long way in ensuring authentic Matlab Assignment Help.

benrusso62060 said...

I am utterly pleased with the services that they offered me on my SAS assignment. The Statistics assignment help expert I worked with did everything to perfection. They are very professional in what they do. I do not have enough words to praise their services. Once they were done with my assignment, I offered them a new task. Contact them if you are looking for an statistics homework help expert to do your statistics homework at an affordable price.

benrusso62060 said...

I have not been able to find an Economics Assignment Help expert with the ability to offer quality and timeliness. If you can offer the two, I wouldn’t have a problem keeping you as my full-time Economics homework help expert. I am still in my second year and therefore I am looking for one reliable expert who we can work together until I finish school.

benrusso62060 said...

I was referred to MatlabAssignmentExperts by a friend because I needed help completing my communication systems assignment. When I submitted my requirements, I thought maybe the Matlab homework helptutor handling the paper would like to discuss the task a little bit more with me before they started working on it but that was not the case. There was no communication until when they were delivering the work. I am glad they sent me a quality solution but I still feel constant communication would go a long way in ensuring authentic Matlab Assignment Help.

benrusso62060 said...

Hi. I have just come across your Programming homework help portal. I have a Java assignment which is required in 48 hours. I am therefore looking for an effective and timely person to provide Java homework help for me. If you are in a position to complete the task in 48 hours please reply to my email. I have indicated all the instructions in the email I have sent. And as you reply to the email please send a sample done by you. Thank you. I will requireC++ homework help, Python Homework Help and C homework help experts shortly. It will be great if I can find anyone who provides complete Programming Coursework Help.

Glen Maxy said...

Civil Law Assignment Help relates to a lot of guidelines that are applied to criminal offenses. For situations where an element won't adjust to a specific criminal rule, by disregarding the law, the person is carrying out a criminal demonstration.

James Marcus said...

Great post and thanks for sharing. We are here to troubleshoot printer issues, the printer is a very useful machine but when we try to use it then users get some issues with it like printer offline windows 10, the HP printer driver is unavailable, HP printer offline, and others. If you are one of them who wants to use a printer and need some HP Support then you may contact us for help. We are here to provide support for printers, so feel free to contact us.
There are different types of issues we get with printers like:
Printer driver is unavailable
HP printer driver is unavailable
Printer driver is unavailable
How to get printer online?
My printer is offline
HP printer keeps going offline
HP printer installation
And our HP Printer Support, if you think you need an independent expert help.
Thank You

Gayathri said...

Thanks for the Information

Urbanrise Spring is in the Air
Sri Aditya Athena
PVR Anmol
PVR Kshetra
Ambience Courtyard
Prestige Tranquil

Post a Comment