From d7eaf3d2d346428008a49d326874a3a450a7230e Mon Sep 17 00:00:00 2001 From: aslesha <cb.en.u4cse16259@cb.students.amrita.edu> Date: Wed, 27 Feb 2019 13:12:13 +0530 Subject: [PATCH] Upload New File --- lab7/cse16259_q1.ipynb | 208 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 lab7/cse16259_q1.ipynb diff --git a/lab7/cse16259_q1.ipynb b/lab7/cse16259_q1.ipynb new file mode 100644 index 0000000..aa6de7c --- /dev/null +++ b/lab7/cse16259_q1.ipynb @@ -0,0 +1,208 @@ +{ + "cells": [ + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": "import requests\npage1 = requests.get(\"https://economictimes.indiatimes.com/news/defence/pulwama-planned-at-balakot-terror-training-centre-had-250-wards/articleshow/68177824.cms\")\npage1\npage2 = requests.get(\"https://www.ndtv.com/india-news/india-struck-biggest-training-camp-of-jaish-in-balakot-large-number-of-terrorists-eliminated-governm-1999390\")\npage2\npage3 = requests.get(\"https://economictimes.indiatimes.com/news/politics-and-nation/iaf-air-strike-in-pakistan-live-updates/liveblog/68162278.cms\")\npage3\npage1.status_code\npage2.status_code\npage3.status_code", + "execution_count": 29, + "outputs": [ + { + "output_type": "execute_result", + "execution_count": 29, + "data": { + "text/plain": "200" + }, + "metadata": {} + } + ] + }, + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": "from bs4 import BeautifulSoup\nsoup1 = BeautifulSoup(page1.content, 'html.parser')\nsoup2 = BeautifulSoup(page2.content, 'html.parser')\nsoup3 = BeautifulSoup(page3.content, 'html.parser')", + "execution_count": 30, + "outputs": [] + }, + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": "import pandas", + "execution_count": 61, + "outputs": [] + }, + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": "main_c = Counter() # keep all results here\nurls = ['https://economictimes.indiatimes.com/news/defence/pulwama-planned-at-balakot-terror-training-centre-had-250-wards/articleshow/68177824.cms','https://www.ndtv.com/india-news/india-struck-biggest-training-camp-of-jaish-in-balakot-large-number-of-terrorists-eliminated-governm-1999390']\nfor url in urls:\n website = requests.get(url)\n soup = BeautifulSoup(website.content)\n texts = soup.findAll(text=True)\n a = Counter([x.lower() for y in texts for x in y.split()])\n b = (a.most_common())\n main_c.update(b)\nmake_a_frame = pd.DataFrame(main_c.most_common())\nmakeaframe=make_a_frame.columns = ['Words', 'Frequency']\nif(makeaframe==\"india\"):\n print(makeaframe.word)\n\nmake_a_frame.columns = ['Words', 'Frequency']\nprint(make_a_frame)", + "execution_count": 66, + "outputs": [ + { + "output_type": "stream", + "text": " Words Frequency\n0 (?, 13) 2\n1 (india, 13) 2\n2 (us, 5) 2\n3 (said., 5) 2\n4 (-1), 4) 2\n5 (s, 3) 2\n6 (function(), 3) 2\n7 (expires, 2) 2\n8 ({};, 2) 2\n9 (_comscore, 2) 2\n10 (prime, 2) 2\n11 (may, 2) 2\n12 (2019, 2) 2\n13 (tv, 2) 2\n14 (about, 2) 2\n15 (azhar,, 2) 2\n16 (comment, 2) 2\n17 (set, 1) 2\n18 (\"\",, 1) 2\n19 (itself, 1) 2\n20 ((var, 1) 2\n21 (<, 1) 2\n22 (i++), 1) 2\n23 (settimeout(function, 1) 2\n24 ('<a, 1) 2\n25 (div, 1) 2\n26 (fixed;, 1) 2\n27 (false;, 1) 2\n28 (true});, 1) 2\n29 (c1:, 1) 2\n... ... ...\n3508 (iframe{, 1) 1\n3509 (@media, 1) 1\n3510 (screen, 1) 1\n3511 ((max-width:479px){, 1) 1\n3512 (.lwrdtl-i{, 1) 1\n3513 (flex;, 1) 1\n3514 (white-space:, 1) 1\n3515 (nowrap;, 1) 1\n3516 (overflow:, 1) 1\n3517 (.lwrdtl{, 1) 1\n3518 (.wdgt_contnr{, 1) 1\n3519 (flex-shrink:, 1) 1\n3520 (width:75vw}, 1) 1\n3521 (.wdgt_contnr:first-child:after{right:, 1) 1\n3522 (-3vw;}, 1) 1\n3523 (1;$(document).ready(function(){, 1) 1\n3524 ($('.hdttl').on('click',, 1) 1\n3525 ({$(this).toggleclass('actv');$('.lwrdtl').sto... 1\n3526 ('none', 1) 1\n3527 (status==1){var, 1) 1\n3528 (iframe, 1) 1\n3529 (document.getelementbyid('consfrm_new');iframe... 1\n3530 (iframe.src;status, 1) 1\n3531 (0;}});});, 1) 1\n3532 (.topnav2014, 1) 1\n3533 (.topnav_expand, 1) 1\n3534 (li.n_telethon{background-image:, 1) 1\n3535 (url(https://www.ndtv.com/static/ndtv_2014/ima... 1\n3536 (background-position:, 1) 1\n3537 (2px;}, 1) 1\n\n[3538 rows x 2 columns]\n", + "name": "stdout" + } + ] + }, + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": "import bs4\nfrom bs4 import BeautifulSoup as soup\nfrom urllib.request import urlopen\nimport requests\nlist1=[]\nlist2=[]\nlist3=[]\npage = requests.get(\"https://www.bloombergquint.com/politics/pre-dawn-indian-air-strike-destroys-jem-camp-in-pakistan-sources-say-up-to-350-terrorists-killed-3#gs.28JrD77a\")\nsoupy = soup(page.content, 'html.parser')\nk3=soupy.select('div#card-5edda4b8-eb61-4b3e-ad83-27b0350fe255')\nfor i in k3:\n print(i.get_text()+\"\\n\")\n list3.append(i.get_text())\nprint(list3)", + "execution_count": 50, + "outputs": [ + { + "output_type": "stream", + "text": "In a pinpointed and swift air strike that lasted less than two minutes, India pounded Jaish-e-Mohammed's biggest training camp in Pakistan early Tuesday, killing up to 350 terrorists and trainers who were moved there for their protection after the Pulwama attack, officials said.The pre-dawn operation described as \"non-military\" and \"preemptive\" struck a five-star resort style camp on a hilltop forest that provided a dozen Mirage 2000 fighter jets of the Indian Air Force with a \"sitting duck target\" and caught the terrorists in their sleep, sources said. The strike is the first by the IAF inside Pakistan after the 1971 war.“I want to assure the people that the country is in safe hands. There is nothing above the nation,” Prime Minister Narendra Modi said at a public rally in Churu, Rajasthan, in his first remarks after the strike. He, however, did not make a direct reference to the attack or give any details of the operation described by some as an aerial surgical strike.Foreign Secretary Vijay Gokhale told the media that the \"intelligence-led operation\" on the Pakistan-based terror group's biggest training camp in Balakot became \"absolutely necessary\" as it was planning more suicide attacks in India, after the Feb. 14 attack on a CRPF convoy in Pulwama in which 40 soldiers were killed. The JeM claimed responsibility for the Pulwama strike.Gokhale said the camp was located in Balakot but did not elaborate further. Sources said the reference was to the town in Pakistan's Khyber Pakhtunkhwa province, about 80 km from the Line of Control and near Abbotabad where Al Qaeda’s Osama bin Laden was killed in 2011.Gokhale also did not give details of how the attacks were carried out but official sources said the synchronised operation involved 12 Mirage 2000 aircraft supported by a fleet of Sukhoi 30 jets, a mid-air refueller and two Airborne Warning and Control System.The sources said the IAF jets used a number of laser-guided bombs, each weighing over 1,000 kg, to destroy the terror camp, about 20 km from Balakot town.The operation began at around 3:45 am and concluded by 4:05 am while the actual strike lasted for less than two minutes, the sources said. The aircraft took off from a number of bases, they said.Prime Minister Modi was up all night as he monitored the IAF operation, relaxing only after all the pilots returned safely home, government sources said. He congratulated all those involved in the operation at around 4.30 am.The attack stunned Pakistan which vowed to respond \"at the time and place of its choosing\" and raise the matter at the United Nations and other international forums.At a hurriedly-called special meeting of the National Security Committee—the country's top security body—hours after India's air strikes, Prime Minister Imran Khan asked the armed forces and the people of his country to remain prepared for \"all eventualities.\"\"The forum (NSC) strongly rejected Indian claim of targeting an alleged terrorist camp near Balakot and the claim of heavy casualties....,\"said a statement issued after the NSC meeting in Islamabad.The country's top civil and military brass \"concluded that India has committed uncalled for aggression to which Pakistan shall respond at the time and place of its choosing,\" it added.Pakistan Army confirmed that Indian fighter jets dropped \"four bombs\" during the operation but downplayed its significance, saying the Indian attack was repulsed and while going back the aircraft \"jettisoned their payload.\"Army spokesman Maj Gen Asif Ghafoor said Pakistan will \"surprise\" India with its response that will be in all domains including \"diplomatic, political and military.\"\"Prime Minister Imran Khan told the army and the people that get ready for any eventuality. Now it is time for India to wait for our response. We have decided. Wait for it,\" Ghafoor said.India received intelligence that the JeM had shifted many in-training terrorists and hardcore operatives, along with their trainers, to the camp, which has facilities for 500 to 700 people and even a swimming pool, sources said.In a synchronised operation, fighter and other aircraft took off from several air bases in Western and Central commands at about the same time, leaving Pakistani defence officials confused about where they were heading, they said.A small group of aircraft broke away from the swarm and headed to Balakot where \"the sleeping terrorists were sitting ducks for the Indian bombing\", said one source.\"Credible intelligence was received that JeM was attempting another suicide terror attack in various parts of the country, and the fidayeen jihadis were being trained for this purpose,\" Gokhale told the media.In the face of imminent danger, a preemptive strike became \"absolutely necessary\", the foreign secretary said.\"In this operation, a very large number of JeM terrorists, trainers, senior commanders and groups of jihadis who were being trained for fidayeen action were eliminated,\" he said, stressing that care was taken to avoid civilian casualties.At least 325 terrorists and 25 to 27 trainers were at the camp, sources told PTI.The facility at Balakot, located in a thick forest on a hilltop far from civilian presence, was headed by Maulana Yousuf Azhar, alias Ustad Ghouri, the brother-in-law of JeM chief Masood Azhar, he said, reading out from a statement.The statement did not say if Yousuf Azhar was among those killed.Leaders cutting across the political divide came together to hail the IAF strikes at an all party meeting.While opposition leaders, including Congress president Rahul Gandhi, kept their reactions to praising the IAF, BJP leaders and their allies used what is being seen as Indian retaliation following the Pulwama attack to laud Modi's decisive leadership and political will which, they asserted, have driven the response from the armed forces.Family members of the CRPF personnel, who lost their lives in the Pulwama attack, said they have found some solace in the airstrikes but pressed for efforts to wipe out the menace of terrorism \"once and for all\".We were expecting a strong response to Pakistan from India and this has been done now. Our loss is irreparable but we are satisfied with what has been done, said Mahesh Gurjar, a cousin of slain CRPF soldier Narayan Lal Gurjar.Jubilant people came out on streets and marches were held as the news of the IAF's strike was hailed across the country.India, Gokhale said, expects Pakistan to dismantle all terror camps, including those of the JeM.Also read: After IAF Air Strikes, Pak Resorts to Heavy Shelling Along LoCThe sentiment also echoed in state assemblies with the legislatures in Haryana, Maharashtra and Chhattisgarh passing resolutions praising the IAF action.According to sources, terrorists in the Balakot camp were imparted the advanced 'Daura-e-Khaas' training in weapons, explosives and field tactics, attack on convoys of security forces, planting and making of IEDs, suicide bombing, rigging vehicles for suicide attacks and survival tactics in high altitudes and extreme-stress situations.\n\n['In a pinpointed and swift air strike that lasted less than two minutes, India pounded Jaish-e-Mohammed\\'s biggest training camp in Pakistan early Tuesday, killing up to 350 terrorists and trainers who were moved there for their protection after the Pulwama attack, officials said.The pre-dawn operation described as \"non-military\" and \"preemptive\" struck a five-star resort style camp on a hilltop forest that provided a dozen Mirage 2000 fighter jets of the Indian Air Force with a \"sitting duck target\" and caught the terrorists in their sleep, sources said. The strike is the first by the IAF inside Pakistan after the 1971 war.“I want to assure the people that the country is in safe hands. There is nothing above the nation,” Prime Minister Narendra Modi said at a public rally in Churu, Rajasthan, in his first remarks after the strike. He, however, did not make a direct reference to the attack or give any details of the operation described by some as an aerial surgical strike.Foreign Secretary Vijay Gokhale told the media that the \"intelligence-led operation\" on the Pakistan-based terror group\\'s biggest training camp in Balakot became \"absolutely necessary\" as it was planning more suicide attacks in India, after the Feb. 14 attack on a CRPF convoy in Pulwama in which 40 soldiers were killed. The JeM claimed responsibility for the Pulwama strike.Gokhale said the camp was located in Balakot but did not elaborate further. Sources said the reference was to the town in Pakistan\\'s Khyber Pakhtunkhwa province, about 80 km from the Line of Control and near Abbotabad where Al Qaeda’s Osama bin Laden was killed in 2011.Gokhale also did not give details of how the attacks were carried out but official sources said the synchronised operation involved 12 Mirage 2000 aircraft supported by a fleet of Sukhoi 30 jets, a mid-air refueller and two Airborne Warning and Control System.The sources said the IAF jets used a number of laser-guided bombs, each weighing over 1,000 kg, to destroy the terror camp, about 20 km from Balakot town.The operation began at around 3:45 am and concluded by 4:05 am while the actual strike lasted for less than two minutes, the sources said. The aircraft took off from a number of bases, they said.Prime Minister Modi was up all night as he monitored the IAF operation, relaxing only after all the pilots returned safely home, government sources said. He congratulated all those involved in the operation at around 4.30 am.The attack stunned Pakistan which vowed to respond \"at the time and place of its choosing\" and raise the matter at the United Nations and other international forums.At a hurriedly-called special meeting of the National Security Committee—the country\\'s top security body—hours after India\\'s air strikes, Prime Minister Imran Khan asked the armed forces and the people of his country to remain prepared for \"all eventualities.\"\"The forum (NSC) strongly rejected Indian claim of targeting an alleged terrorist camp near Balakot and the claim of heavy casualties....,\"said a statement issued after the NSC meeting in Islamabad.The country\\'s top civil and military brass \"concluded that India has committed uncalled for aggression to which Pakistan shall respond at the time and place of its choosing,\" it added.Pakistan Army confirmed that Indian fighter jets dropped \"four bombs\" during the operation but downplayed its significance, saying the Indian attack was repulsed and while going back the aircraft \"jettisoned their payload.\"Army spokesman Maj Gen Asif Ghafoor said Pakistan will \"surprise\" India with its response that will be in all domains including \"diplomatic, political and military.\"\"Prime Minister Imran Khan told the army and the people that get ready for any eventuality. Now it is time for India to wait for our response. We have decided. Wait for it,\" Ghafoor said.India received intelligence that the JeM had shifted many in-training terrorists and hardcore operatives, along with their trainers, to the camp, which has facilities for 500 to 700 people and even a swimming pool, sources said.In a synchronised operation, fighter and other aircraft took off from several air bases in Western and Central commands at about the same time, leaving Pakistani defence officials confused about where they were heading, they said.A small group of aircraft broke away from the swarm and headed to Balakot where \"the sleeping terrorists were sitting ducks for the Indian bombing\", said one source.\"Credible intelligence was received that JeM was attempting another suicide terror attack in various parts of the country, and the fidayeen jihadis were being trained for this purpose,\" Gokhale told the media.In the face of imminent danger, a preemptive strike became \"absolutely necessary\", the foreign secretary said.\"In this operation, a very large number of JeM terrorists, trainers, senior commanders and groups of jihadis who were being trained for fidayeen action were eliminated,\" he said, stressing that care was taken to avoid civilian casualties.At least 325 terrorists and 25 to 27 trainers were at the camp, sources told PTI.The facility at Balakot, located in a thick forest on a hilltop far from civilian presence, was headed by Maulana Yousuf Azhar, alias Ustad Ghouri, the brother-in-law of JeM chief Masood Azhar, he said, reading out from a statement.The statement did not say if Yousuf Azhar was among those killed.Leaders cutting across the political divide came together to hail the IAF strikes at an all party meeting.While opposition leaders, including Congress president Rahul Gandhi, kept their reactions to praising the IAF, BJP leaders and their allies used what is being seen as Indian retaliation following the Pulwama attack to laud Modi\\'s decisive leadership and political will which, they asserted, have driven the response from the armed forces.Family members of the CRPF personnel, who lost their lives in the Pulwama attack, said they have found some solace in the airstrikes but pressed for efforts to wipe out the menace of terrorism \"once and for all\".We were expecting a strong response to Pakistan from India and this has been done now. Our loss is irreparable but we are satisfied with what has been done, said Mahesh Gurjar, a cousin of slain CRPF soldier Narayan Lal Gurjar.Jubilant people came out on streets and marches were held as the news of the IAF\\'s strike was hailed across the country.India, Gokhale said, expects Pakistan to dismantle all terror camps, including those of the JeM.Also read: After IAF Air Strikes, Pak Resorts to Heavy Shelling Along LoCThe sentiment also echoed in state assemblies with the legislatures in Haryana, Maharashtra and Chhattisgarh passing resolutions praising the IAF action.According to sources, terrorists in the Balakot camp were imparted the advanced \\'Daura-e-Khaas\\' training in weapons, explosives and field tactics, attack on convoys of security forces, planting and making of IEDs, suicide bombing, rigging vehicles for suicide attacks and survival tactics in high altitudes and extreme-stress situations.']\n", + "name": "stdout" + } + ] + }, + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": "page1 = requests.get(\"https://economictimes.indiatimes.com/news/defence/how-indias-first-air-strike-in-pakistani-territory-since-1971-unfolded/articleshow/68177109.cms\")\nsoupy1 = soup(page1.content, 'html.parser')\nk1=soupy1.find(class_=\"clearfix title\").get_text()\nlist11=[]\nlist11.append(k1)\ndata=soupy1.find(class_=\"Normal\").get_text()\n#print(data)\nlist1=data.split('\\n')\n#print(datalist)\n1\nfor i in list1:\n print(i)", + "execution_count": 52, + "outputs": [ + { + "output_type": "stream", + "text": "India took down the largest Jaish-e-Mohammad terror training camp in Pakistan in a meticulously planned early morning air raid on Tuesday, terming it a “non-military, preemptive” strike based on credible intelligence that terrorists based in the camp were being trained for another suicide bombing in India.\n\nThe strikes — India’s first such air raid into Pakistan since the 1971 war — targeted the Balakot training camp located in Khyber Pakhtunkhwa province, beyond Pakistan-occupied Kashmir. The camp was a busy location with terrorists congregating there after retreating from forward staging areas in anticipation of Indian action after the Pulwama terror attack in which 40 CRPF jawans were killed.\n\nDeclaring the strike as necessary to “fight the menace of terrorism”, foreign secretary Vijay Gokhale said a “very large number” of terrorists had been eliminated. Sources in the government estimated the casualties at over 300.\n\n“In an intelligence-led operation in the early hours of today (Tuesday), India struck the biggest training camp of JeM in Balakot. In this operation, a very large number of JeM terrorists, trainers, senior commanders and groups of jihadis who were being trained for fidayeen action were eliminated,” Gokhale said.\n\n\n\n\nWhile a post-strike assessment is being carried out, the announcement of the air strikes has added a new dynamic to the Indo-Pak conflict in Kashmir that till now had been limited to ground raids, artillery exchanges and sniping across the Line of Control (LoC).\n\nET has gathered that the alleged mastermind of the Pulwama attack, JeM commander Abdul Rasheed Ghazi, is believed to have trained at the Balakot training camp.\n\nIndia Puts Out Nuanced Statement\nA dozen fighter jets were involved in the operation that saw the Dassault Mirage 2000 combat aircraft dropping SPICE-2000 precision bombs from along the LoC to strike targets at a range of over 60 km. The Mirages were backed by Su-30 MKI fighter jets that provided air support.\n\nThose familiar with the details told ET that the strikes were carried out from just across the LoC, and that the jets did not need to go deep into Pakistan as long-range bombs were used. Pakistan has alleged that Indian fighter jets violated the LoC by “3-4 miles”.\n\nSix buildings at the camp — run by Maulana Yousuf Azhar, also known as Ustad Ghouri, the brother-in-law of JeM chief Masood Azhar — were targeted by the Indian jets.\n\nThe Pakistani air force was alerted to the strike, but sources said it had no time to respond given the speed of the operation. They confirmed that while PAF jets did take off, they could not engage the Indian strike formation given its numerical superiority.\n\nIncidentally, Balakot is located within 60 km of Abbottabad, where US special forces gunned down Al Qaeda chief Osama bin Laden in a covert operation in 2011.\n\nTwo other locations at Chakoti and Muzaffarabad are also believed to have been hit in the strikes, but were not mentioned in the official statement by the Indian government.\n\nBy terming the action as ‘non-military’, India has sought to control a possible escalation by signalling that the targets were non-state actors and not the Pakistani armed forces. The Pakistani military has, however, claimed that there was no damage to infrastructure at Balakot and that the bombs fell on a mountainside.\n\nThe foreign secretary said the action was on the basis of precise intelligence and that the target was chosen specifically to avoid civilian casualties. “The facility is located in a thick forest on a hilltop, far away from any civilian presence,” Gokhale said.\n\nIndia has asked Pakistan to dismantle all JeM camps and infrastructure, and to hold terrorists accountable for their acts. It also said the massive facility that was capable of training hundreds of jihadis could not have functioned without the knowledge of Pakistani authorities.\n\n\n", + "name": "stdout" + } + ] + }, + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": " page = requests.get(\"https://www.theguardian.com/world/2019/feb/26/pakistan-india-jets-breached-ceasefire-line-kashmir-bomb\")\nsoupy2 = soup(page.content, 'html.parser')\nk2=soupy2.find(class_=\"content__article-body from-content-api js-article__body\").get_text()\nprint(k2)\nlist2.append(k2)\ndata2=soupy2.find(class_=\"content__article-body from-content-api js-article__body\").get_text()\n2\nprint(list2)", + "execution_count": 53, + "outputs": [ + { + "output_type": "stream", + "text": "\nPakistan’s army has warned it will respond to India’s aerial bombing over the disputed border in Kashmir, telling Delhi: “It is your turn now to wait and get ready for our surprise.”\nPakistan’s foreign ministry has summoned India’s top diplomat in Islamabad to protest against the pre-dawn airstrike on what India called a terrorist training camp, while India has accused Islamabad of shelling the disputed region in an “unprovoked” violation of the 2003 ceasefire.\nTensions between the nuclear-armed neighbours have escalated in recent weeks with the killing of 40 Indian security personnel in a suicide bombing, and now Tuesday’s airstrike – the first such attack by India since it went to war with Pakistan in 1971.\nIndia’s foreign secretary, Vijay Gokhale, called the attack “a pre-emptive strike” after receiving credible intelligence that the militant group Jaish-e-Mohammed (JeM), which was behind the recent suicide bombing, was training fighters for similar attacks at the site.\nImran Khan, the Pakistani prime minister, said India’s claim that it had hit a terrorist training camp at Balakot was “a self-serving, reckless and fictitious claim”.\n\n\n\n\nThe Guardian view on Kashmir: the world’s most dangerous place | Editorial\n\n\n\n\n\n\n \n\n\nRead more\n\n\n\n\n\n\n“This action has been done for domestic consumption in the election environment, putting regional peace and stability at grave risk,” Khan said, referring to India’s general election which starts in two months.\nPakistan’s armed forces spokesman, Maj-Gen Asif Ghafoor,said a joint session of Pakistan’s parliament would be held on Wednesday, followed by a meeting of the National Command Authority, whose responsibilities include overseeing the country’s nuclear arsenal.\nThe attack was celebrated in India, but it was unclear on Tuesday whether anything significant had been struck by the fighter jets, or whether the operation had been carefully calibrated to ease popular anger over the 14 February suicide bombing without drawing a major Pakistani reprisal.\nPakistan, which was the first to announce the incursion, said the war planes made it up to five miles inside its territory before they were rebuffed, dropping their payloads without casualties or damage.\nGhafoor, tweeted on Tuesday morning that the Indian jets had dropped their bombs in an empty forested area. “No infrastructure got hit, no casualties,” he wrote.\n\n\n Quick guide Kashmir conflict – quick guide \n\n\n Show \n\n\n Hide \n\n\n\nKashmir, a disputed region in the foothills of the Himalayas, has been at the centre of tensions between India and Pakistan since both states came into being in 1947.\n\n\n\nWho controls Kashmir?\n\nBoth claim it in full, but each controls a section of the territory, separated by one of the most heavily militarised borders in the world: the “line of control” based on a ceasefire border established after a 1947-48 war over the region. China controls another part in the east.\nIndia and Pakistan have gone to war three times over Kashmir, most recently in 1999. Artillery, mortar and small arms fire is still frequently exchanged over the ceasefire line.\n\n\n\nHow did the dispute start?\n\nThe roots of the conflict date back to the weeks after the partition of colonial India 71 years ago. Small, semi-autonomous “princely states” across the subcontinent were being folded into either India or Pakistan. The ruler of Kashmir dithered over which to join – until tribal fighters poured in from Pakistan, intent on winning the region for Islamabad.\nKashmir turned to Delhi for assistance, signing a treaty of accession with India in exchange for the intervention of Indian troops, who fought the Pakistanis to the modern-day line of control.\nIn 1948, the UN security council issued Resolution 47 calling for a referendum among Kashmiris to determine which country the region would join, or whether it would become an independent state. That referendum has never been held.\nIn its 1950 constitution, India granted Kashmir a large measure of independence. But, in the years since, it has eroded some of that autonomy and repeatedly intervened to rig elections and dismiss and jail democratically elected leaders.\n\n\n\nWhat do the militants want?\n\nFor the past three decades, Indian-controlled Kashmir has been roiled by an armed insurgency against its rule. Indian soldiers and Pakistan-backed guerillas fought a dirty war replete with accusations of torture, forced disappearances and extra-judicial killing.\nUntil 2004, the militancy was made up largely of Pakistani and Afghan fighters. But since then, especially after massive popular protests were put down with extreme force in 2016, locals have made up a growing share of the anti-India fighters.\nFor Indians, control of Kashmir — part of the country’s only Muslim-majority state — has been proof of its commitment to religious pluralism. For Pakistan, a state founded as a homeland for south Asian Muslims, Kashmir is the last occupied home of its co-religionists. Michael Safi\n\n\n\n\n\n Photograph: Aqeel Ahmed/AP\n\n\n\n\n\nWas this helpful?\n\n\n\n\n\n\n\n\n\n\n\nThank you for your feedback.\n\n\n\n\nTuesday’s attacks followed nearly a fortnight of sabre-rattling between the pair over the southern Kashmir suicide bombing, in which India has claimed Pakistan had a “direct hand”. JeM is based in Pakistan but Islamabad has rejected any responsibility for the attack.\n\nMap\n\nGokhale said Indian jets struck JeM’s largest training camp in the Balakot area, claiming a “very large number of JeM terrorists, trainers, senior commanders and groups of jihadis being trained for fidayeen [suicide] action were eliminated.” The facility, which he described as being in thick forest on a hilltop, was far away from any civilian settlements,overseen by the brother-in-law of the JeM chief, Masood Azhar, he added.\nSignificantly, Balakot is in the province of Khyber Pakhtunkhwa, about 50 miles from the line of control and well into accepted Pakistan territory. An attack there would represent an escalation from previous Indian reprisals.\n“It changes the game significantly by raising the costs for Pakistan,” said Khalid Shah, a research fellow at the Delhi-based Observer Research Foundation.\nIslamabad released pictures on social media showing uprooted trees and cratered soil, which it claimed was the extent of the damage from the Indian bombing.\nLocal media in Pakistan as well as Reuters quoted residents of Balakot who said they heard four to five blasts overnight which damaged homes and left large pockmarks in the ground.\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n \n\n \n\n\n Facebook \n \n\n\n Twitter \n \n\n\n Pinterest \n\n\n\n\n\n A photograph released by Pakistan of what it says was damage caused by bombing in Balakot. Photograph: AFP/Getty Images\n\n\nThe conflicting narratives over the attack echo India’s claims in September 2016 it sent special forces to destroy militant facilities over the ceasefire border – an attack that Pakistan still maintains never happened.\nThe opposing positions allowed India to trumpet its reprisal against Pakistan without forcing Islamabad to respond in a way that might spiral into a larger conflict.\nIndian ministers lauded the airstrikes. “It was an act of extreme valour,” said Prakash Javadekar, the human resources development minister, in the first official acknowledgement of the operation.\nAnother minister, Vijay Kumar Singh, posted a picture on Twitter of an eagle with a snake in its talons. “They say they want to bleed India with 1,000 cuts,” he wrote. “We say that each time you attack us, be certain we will get back at you, harder and stronger.”\nDespite Pakistan downplaying the impact of the attacks, Khan, whose successful election campaign last year featured strident promises to stand up to India, could still face popular pressure to respond.\n“Strategically, it is a disaster for Pakistan that India can keep doing this,” said Mosharraf Zaidi, a political analyst and columnist, referring to both Tuesday’s attack and the September 2016 strikes. “What does it say about Pakistan’s red lines that countries like India can keep violating our airspace or claim they have carried out surgical strikes?”\nSherry Rahman, a Pakistani senator and former ambassador the US, said the attack was aimed at Indian PM Narendra Modi’s re-election. “India is giving its own people a message with these strikes; this is for their electorate, the domestic voters.”\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n \n\n \n\n\n Facebook \n \n\n\n Twitter \n \n\n\n Pinterest \n\n\n\n\n\n A detail of wreckage at the scene, released by Pakistan. Photograph: AFP/Getty Images\n\n\nWhile exchanges of artillery and light weapons over the line are very common, intentional incursions by aircraft have not been publicly acknowledged since the two countries fought a war in 1971.\nMilitary planes could be heard over Srinagar, the capital of Indian-controlled Kashmir, in the early hours of Tuesday morning. There has been a large troop buildup in the region in recent days and doctors have been advised to cancel leave and stockpile medicines.\nSeveral convoys of trucks carrying heavy artillery were being transported on highways to northern Kashmir towards the line of control. Both India and Pakistan were trading heavy mortar fire across the ceasefire line on Tuesday night.\nMore than 300 Kashmiri separatist activists have been detained in recent days. Hours after the attack on Tuesday morning, officers from the National Investigation Agency raided the Srinagar homes of two veteran separatist leaders, Yasin Malik, who was among those detained at the weekend, and Mirwaiz Umar Farooq.\nAssociated Press contributed to this report\n\n\nTopics\n\n\n\n\nKashmir\n\n\n\n\n\n\n\n\nPakistan\n\n\n\n\nIndia\n\n\n\n\nSouth and Central Asia\n\n\n\n\nnews\n\n\n\n\n\n\n\n\nShare on Facebook\n\n\n\n\n\n\n\n\n\nShare on Twitter\n\n\n\n\n\n\n\n\n\nShare via Email\n\n\n\n\n\n\n\n\n\nShare on LinkedIn\n\n\n\n\n\n\n\n\n\nShare on Pinterest\n\n\n\n\n\n\n\n\n\nShare on WhatsApp\n\n\n\n\n\n\n\n\n\nShare on Messenger\n\n\n\n\n\n\n\n\n\n\n\n\n\nReuse this content\n\n\n\n\n\n\n['\\nPakistan’s army has warned it will respond to India’s aerial bombing over the disputed border in Kashmir, telling Delhi: “It is your turn now to wait and get ready for our surprise.”\\nPakistan’s foreign ministry has summoned India’s top diplomat in Islamabad to protest against the pre-dawn airstrike on what India called a terrorist training camp, while India has accused Islamabad of shelling the disputed region in an “unprovoked” violation of the 2003 ceasefire.\\nTensions between the nuclear-armed neighbours have escalated in recent weeks with the killing of 40 Indian security personnel in a suicide bombing, and now Tuesday’s airstrike – the first such attack by India since it went to war with Pakistan in 1971.\\nIndia’s foreign secretary, Vijay Gokhale, called the attack “a pre-emptive strike” after receiving credible intelligence that the militant group Jaish-e-Mohammed (JeM), which was behind the recent suicide bombing, was training fighters for similar attacks at the site.\\nImran Khan, the Pakistani prime minister, said India’s claim that it had hit a terrorist training camp at Balakot was “a self-serving, reckless and fictitious claim”.\\n\\n\\n\\n\\nThe Guardian view on Kashmir: the world’s most dangerous place | Editorial\\n\\n\\n\\n\\n\\n\\n \\n\\n\\nRead more\\n\\n\\n\\n\\n\\n\\n“This action has been done for domestic consumption in the election environment, putting regional peace and stability at grave risk,” Khan said, referring to India’s general election which starts in two months.\\nPakistan’s armed forces spokesman, Maj-Gen Asif Ghafoor,said a joint session of Pakistan’s parliament would be held on Wednesday, followed by a meeting of the National Command Authority, whose responsibilities include overseeing the country’s nuclear arsenal.\\nThe attack was celebrated in India, but it was unclear on Tuesday whether anything significant had been struck by the fighter jets, or whether the operation had been carefully calibrated to ease popular anger over the 14 February suicide bombing without drawing a major Pakistani reprisal.\\nPakistan, which was the first to announce the incursion, said the war planes made it up to five miles inside its territory before they were rebuffed, dropping their payloads without casualties or damage.\\nGhafoor, tweeted on Tuesday morning that the Indian jets had dropped their bombs in an empty forested area. “No infrastructure got hit, no casualties,” he wrote.\\n\\n\\n Quick guide Kashmir conflict – quick guide \\n\\n\\n Show \\n\\n\\n Hide \\n\\n\\n\\nKashmir, a disputed region in the foothills of the Himalayas, has been at the centre of tensions between India and Pakistan since both states came into being in 1947.\\n\\n\\n\\nWho controls Kashmir?\\n\\nBoth claim it in full, but each controls a section of the territory, separated by one of the most heavily militarised borders in the world: the “line of control” based on a ceasefire border established after a 1947-48 war over the region. China controls another part in the east.\\nIndia and Pakistan have gone to war three times over Kashmir, most recently in 1999. Artillery, mortar and small arms fire is still frequently exchanged over the ceasefire line.\\n\\n\\n\\nHow did the dispute start?\\n\\nThe roots of the conflict date back to the weeks after the partition of colonial India 71 years ago. Small, semi-autonomous “princely states” across the subcontinent were being folded into either India or Pakistan. The ruler of Kashmir dithered over which to join – until tribal fighters poured in from Pakistan, intent on winning the region for Islamabad.\\nKashmir turned to Delhi for assistance, signing a treaty of accession with India in exchange for the intervention of Indian troops, who fought the Pakistanis to the modern-day line of control.\\nIn 1948, the UN security council issued Resolution 47 calling for a referendum among Kashmiris to determine which country the region would join, or whether it would become an independent state. That referendum has never been held.\\nIn its 1950 constitution, India granted Kashmir a large measure of independence. But, in the years since, it has eroded some of that autonomy and repeatedly intervened to rig elections and dismiss and jail democratically elected leaders.\\n\\n\\n\\nWhat do the militants want?\\n\\nFor the past three decades, Indian-controlled Kashmir has been roiled by an armed insurgency against its rule. Indian soldiers and Pakistan-backed guerillas fought a dirty war replete with accusations of torture, forced disappearances and extra-judicial killing.\\nUntil 2004, the militancy was made up largely of Pakistani and Afghan fighters. But since then, especially after massive popular protests were put down with extreme force in 2016, locals have made up a growing share of the anti-India fighters.\\nFor Indians, control of Kashmir — part of the country’s only Muslim-majority state — has been proof of its commitment to religious pluralism. For Pakistan, a state founded as a homeland for south Asian Muslims, Kashmir is the last occupied home of its co-religionists. Michael Safi\\n\\n\\n\\n\\n\\n Photograph: Aqeel Ahmed/AP\\n\\n\\n\\n\\n\\nWas this helpful?\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nThank you for your feedback.\\n\\n\\n\\n\\nTuesday’s attacks followed nearly a fortnight of sabre-rattling between the pair over the southern Kashmir suicide bombing, in which India has claimed Pakistan had a “direct hand”. JeM is based in Pakistan but Islamabad has rejected any responsibility for the attack.\\n\\nMap\\n\\nGokhale said Indian jets struck JeM’s largest training camp in the Balakot area, claiming a “very large number of JeM terrorists, trainers, senior commanders and groups of jihadis being trained for fidayeen [suicide] action were eliminated.” The facility, which he described as being in thick forest on a hilltop, was far away from any civilian settlements,overseen by the brother-in-law of the JeM chief, Masood Azhar, he added.\\nSignificantly, Balakot is in the province of Khyber Pakhtunkhwa, about 50 miles from the line of control and well into accepted Pakistan territory. An attack there would represent an escalation from previous Indian reprisals.\\n“It changes the game significantly by raising the costs for Pakistan,” said Khalid Shah, a research fellow at the Delhi-based Observer Research Foundation.\\nIslamabad released pictures on social media showing uprooted trees and cratered soil, which it claimed was the extent of the damage from the Indian bombing.\\nLocal media in Pakistan as well as Reuters quoted residents of Balakot who said they heard four to five blasts overnight which damaged homes and left large pockmarks in the ground.\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n \\n\\n\\n \\n\\n \\n\\n\\n Facebook \\n \\n\\n\\n Twitter \\n \\n\\n\\n Pinterest \\n\\n\\n\\n\\n\\n A photograph released by Pakistan of what it says was damage caused by bombing in Balakot. Photograph: AFP/Getty Images\\n\\n\\nThe conflicting narratives over the attack echo India’s claims in September 2016 it sent special forces to destroy militant facilities over the ceasefire border – an attack that Pakistan still maintains never happened.\\nThe opposing positions allowed India to trumpet its reprisal against Pakistan without forcing Islamabad to respond in a way that might spiral into a larger conflict.\\nIndian ministers lauded the airstrikes. “It was an act of extreme valour,” said Prakash Javadekar, the human resources development minister, in the first official acknowledgement of the operation.\\nAnother minister, Vijay Kumar Singh, posted a picture on Twitter of an eagle with a snake in its talons. “They say they want to bleed India with 1,000 cuts,” he wrote. “We say that each time you attack us, be certain we will get back at you, harder and stronger.”\\nDespite Pakistan downplaying the impact of the attacks, Khan, whose successful election campaign last year featured strident promises to stand up to India, could still face popular pressure to respond.\\n“Strategically, it is a disaster for Pakistan that India can keep doing this,” said Mosharraf Zaidi, a political analyst and columnist, referring to both Tuesday’s attack and the September 2016 strikes. “What does it say about Pakistan’s red lines that countries like India can keep violating our airspace or claim they have carried out surgical strikes?”\\nSherry Rahman, a Pakistani senator and former ambassador the US, said the attack was aimed at Indian PM Narendra Modi’s re-election. “India is giving its own people a message with these strikes; this is for their electorate, the domestic voters.”\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n \\n\\n\\n \\n\\n \\n\\n\\n Facebook \\n \\n\\n\\n Twitter \\n \\n\\n\\n Pinterest \\n\\n\\n\\n\\n\\n A detail of wreckage at the scene, released by Pakistan. Photograph: AFP/Getty Images\\n\\n\\nWhile exchanges of artillery and light weapons over the line are very common, intentional incursions by aircraft have not been publicly acknowledged since the two countries fought a war in 1971.\\nMilitary planes could be heard over Srinagar, the capital of Indian-controlled Kashmir, in the early hours of Tuesday morning. There has been a large troop buildup in the region in recent days and doctors have been advised to cancel leave and stockpile medicines.\\nSeveral convoys of trucks carrying heavy artillery were being transported on highways to northern Kashmir towards the line of control. Both India and Pakistan were trading heavy mortar fire across the ceasefire line on Tuesday night.\\nMore than 300 Kashmiri separatist activists have been detained in recent days. Hours after the attack on Tuesday morning, officers from the National Investigation Agency raided the Srinagar homes of two veteran separatist leaders, Yasin Malik, who was among those detained at the weekend, and Mirwaiz Umar Farooq.\\nAssociated Press contributed to this report\\n\\n\\nTopics\\n\\n\\n\\n\\nKashmir\\n\\n\\n\\n\\n\\n\\n\\n\\nPakistan\\n\\n\\n\\n\\nIndia\\n\\n\\n\\n\\nSouth and Central Asia\\n\\n\\n\\n\\nnews\\n\\n\\n\\n\\n\\n\\n\\n\\nShare on Facebook\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nShare on Twitter\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nShare via Email\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nShare on LinkedIn\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nShare on Pinterest\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nShare on WhatsApp\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nShare on Messenger\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\n\\nReuse this content\\n\\n\\n\\n\\n\\n']\n", + "name": "stdout" + } + ] + }, + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": "a=set(list1)\nb=set(list2)\nc=set(list3)\nset1=a.intersection(c)\nimport re\ntitleTag1 = soup1.html.head.title\nprint(titleTag1.string)\ntitles1 = soup1.find_all('span', {'class' : 'title-link__title-text'})\nheadlinesa = [t1.text for t1 in titles1]\nprint(headlinesa)\ntitleTag2 = soup2.html.head.title\nprint(titleTag2.string)\ntitles2 = soup2.find_all('span', {'class' : 'title-link__title-text'})\nheadlinesb = [t2.text for t2 in titles2]\nprint(headlinesb)\ntitleTag3 = soup3.html.head.title\nprint(titleTag3.string)\ntitles3 = soup3.find_all('span', {'class' : 'title-link__title-text'})\nheadlinesc = [t3.text for t3 in titles3]\nprint(headlinesc)", + "execution_count": 60, + "outputs": [ + { + "output_type": "stream", + "text": "Balakot: Pulwama planned at Balakot terror training centre, had 250 wards - The Economic Times\n[]\nIndian Air Force IAF Balakot Strike: India Strikes After Pulwama Terror Attack, Hits Biggest Jaish-e-Mohammed Camp In Balakot\n[]\nIAF air strikes live updates: Sushma Swaraj briefs counterparts in US, China, Bangladesh & Afghanistan on Air strikes - The Economic Times\n[]\n", + "name": "stdout" + } + ] + }, + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": "page4 = requests.get(\"https://www.businesstoday.in/current/economy-politics/balakot-air-strike-how-much-damage-can-500-pound-bombs-cause/story/322651.html\")\npage4", + "execution_count": 68, + "outputs": [ + { + "output_type": "execute_result", + "execution_count": 68, + "data": { + "text/plain": "<Response [200]>" + }, + "metadata": {} + } + ] + }, + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": "soup4 = BeautifulSoup(page4.content, 'html.parser')", + "execution_count": 69, + "outputs": [] + }, + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": "titleTag4 = soup4.html.head.title\nprint(titleTag4.string)\ntitles4 = soup4.find_all('span', {'class' : 'title-link__title-text'})\nheadlinesd = [t4.text for t4 in titles4]\nprint(headlinesd)", + "execution_count": 70, + "outputs": [ + { + "output_type": "stream", + "text": "Balakot air strike: How much damage can 500 pound bombs cause?\n[]\n", + "name": "stdout" + } + ] + }, + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": "k4=soup4.find(class_=\"clearfix title\").get_text()\nlist14=[]\nlist14.append(k4)\ndata4=soup4.find(class_=\"Normal\").get_text()\n#print(data)\nlist14=data4.split('\\n')\n#print(datalist)\n1\nfor i in list14:\n print(i)", + "execution_count": 71, + "outputs": [ + { + "output_type": "error", + "ename": "AttributeError", + "evalue": "'NoneType' object has no attribute 'get_text'", + "traceback": [ + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", + "\u001b[0;31mAttributeError\u001b[0m Traceback (most recent call last)", + "\u001b[0;32m<ipython-input-71-b76127efda26>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mk4\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msoup4\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfind\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mclass_\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"clearfix title\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_text\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2\u001b[0m \u001b[0mlist14\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0mlist14\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mappend\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mk4\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0mdata4\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0msoup4\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mfind\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mclass_\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m\"Normal\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_text\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 5\u001b[0m \u001b[0;31m#print(data)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", + "\u001b[0;31mAttributeError\u001b[0m: 'NoneType' object has no attribute 'get_text'" + ] + } + ] + }, + { + "metadata": { + "trusted": true + }, + "cell_type": "code", + "source": "", + "execution_count": null, + "outputs": [] + } + ], + "metadata": { + "kernelspec": { + "name": "python36", + "display_name": "Python 3.6", + "language": "python" + }, + "language_info": { + "mimetype": "text/x-python", + "nbconvert_exporter": "python", + "name": "python", + "pygments_lexer": "ipython3", + "version": "3.6.6", + "file_extension": ".py", + "codemirror_mode": { + "version": 3, + "name": "ipython" + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} \ No newline at end of file -- GitLab