Python Foundation

+91-7982108418            
Table of Contents
                    PYTHON WEBSCRAPING QUESTIONS

1. Write a Python program to find the title tags from a given html document.

2. Write a Python program to retrieve all the paragraph tags from a given html document.

3. Write a Python program to get the number of paragraph tags of a given html document.

4. Write a Python program to extract the text in the first paragraph tag of a given html document.

5. Write a Python program to find the length of the text of the first <h2> tag of a given html document.

6. Write a Python program to find the text of the first <a> tag of a given html text.

7. Write a Python program to find the href of the first  <a> tag of a given html document.

8. Write a Python program to extract all the URLs from the webpage python.org that are nested within <li>tags from .

9. Write a Python program to find all the h2 tags and list the first four from the webpage python.org.

10. Write a Python program to find all the link tags and list the first ten from the webpage python.org.

11. Write a Python program to a list of all the h1, h2, h3 tags from the webpage python.org.

12. Write a Python program to extract all the text from a given web page.

13. Write a Python program to print the names of all HTML tags of a given web page going through the document tree.

14. Write a Python program to retrieve children of the html tag from a given web page.

15. Write a Python program to retrieve all descendants of the body tag from a given web page.

16. Write a Python program to retrieve the HTML code of the title, its text, and the HTML code of its parent.

17. Write a Python program to find and print all li tags of a given web page.

18. Write a Python program to print content of elements that contain a specified string of a given web page.

19. Write a Python program to print the element(s) that has a specified id of a given web page.

20. Write a Python program to create a Beautiful Soup parse tree into a nicely formatted Unicode string, with a separate                line for each HTML/XML tag and string

21. Write a Python program to find the first tag with a given attribute value in an html document.

22. Write a Python program to find tag(s) beneath other tag(s) in a given html document.

23. Write a Python program to find tag(s) directly beneath other tag(s) in a given html document.

24. Write a Python program to find the siblings of tags in a given html document.

25. Write a Python program to find tags by CSS class in a given html document.

26. Write a Python program to change the tag’s contents and replace with the given string.
27. Write a Python program to add to a tag’s contents in a given html document.
28. Write a Python program to insert a new text within a url in a specified position.
29. Write a Python program to insert tags or strings immediately before specified tags or strings.
30. Write a Python program to insert tags or strings immediately after specified tags or strings.
31. Write a Python program to remove the contents of a tag in a given html document.

32. Write a Python program to extract a tag or string from a given tree of html document.
33. Write a Python program to remove a tag from a given tree of html documentm and destroy it and its contents.
34. Write a Python program to remove a tag or string from a given tree of html document and replace it with the given                 tag  or string.
35. Write a Python program to wrap an element in the specified tag and create the new wrapper.
36. Write a Python program to replace a given tag with whatever’s inside a given tag.

37. Write a Python program to test if a given page is found or not on the server.
38. Write a Python program to download and display the content of robot.txt for en.wikipedia.org.
39. Write a Python program to get the number of datasets currently listed on data.gov.
40. Write a Python program to convert an address (like “1600 Amphitheatre Parkway, Mountain View, CA”) into              geographic coordinates (like latitude 37.423021 and longitude -122.083739).
41. Write a Python program to display the name of the most recently added dataset on data.gov.
42. Write a Python program to extract h1 tag from example.com.
43. Write a Python program to extract and display all the header tags from en.wikipedia.org/wiki/Main_Page.
44. Write a Python program to extract and display all the image links from en.wikipedia.org/wiki/Peter_Jeffrey_(RAAF_officer).
45. Write a Python program to get 90 days of visits broken down by browser for all sites on data.gov.

46. Write a Python program to that retrieves an arbitary Wikipedia page of “Python” and creates a list of links on that page.
47. Write a Python program to check whether a page contains a title or not.
48. Write a Python program to list all language names and number of related articles in the order they appear in wikipedia.org.
49. Write a Python program to get the number of people visiting a U.S. government website right now.

50. Write a Python program get the number of security alerts issued by USCERT in the current year.
Source: https://www.us-cert.gov/ncas/alerts
51. Write a Python program to get the number of Pinterest accounts maintained by U.S. State Department embassies and missions.
Source: https://www.state.gov/r/pa/ode/socialmedia/
52. Write a Python program to get the number of followers of a given twitter account.
53. Write a Python program to get the number of following on Twitter.
54. Write a Python program to get the number of post on Twitter liked by a given account.

55. Write a Python program to count number of tweets by a given Twitter account.
56. Write a Python program to scrap number of tweets of a given Twitter account.
57. Write a Python program to find the live weather report (temperature, wind speed, description and weather) of a given city.
58. Write a Python program to display the date, days, title, city, country of next 25 Hackevents.
59. Write a Python program to download IMDB’s Top 250 data (movie name, Initial release, director name and stars).
60. Write a Python program to get movie name, year and a brief summary of the top 10 random movies.
61. Write a Python program to get the number of magnitude 4.5+ earthquakes detected worldwide by the USGS.
62. Write a Python program to display the contains of different attributes like different attributes like status_code, headers, url, history, encoding, reason, cookies, elapsed, request and content of a specified resource.
63. Write a Python program to verifiy SSL certificates for HTTPS requests using requests module.

#

Powered by BetterDocs

Contact Us
close slider

error: Content is protected !!