Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.imdb;
- import java.io.IOException;
- import org.jsoup.Jsoup;
- import org.jsoup.nodes.Document;
- import org.jsoup.nodes.Element;
- import org.jsoup.select.Elements;
- public class FetchIMDBMovieList {
- public static void main(String[] args) {
- try {
- Document doc=Jsoup.connect("https://www.imdb.com/search/title/?title_type=feature&num_votes=25000,&genres=action&sort=alpha,asc").userAgent("Brave/1.10").get();
- Elements temp = doc.select("h3.lister-item-header");
- int i=0;
- for(Element movieList:temp)
- {
- i++;
- System.out.println(i+ " "+ movieList.getElementsByTag("a").first().text());
- }
- }
- catch(IOException e) {
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement